From 71e707789d8710430a86606e002374da1ad0c496 Mon Sep 17 00:00:00 2001 From: Kirill Radzikhovskyy Date: Tue, 30 Dec 2025 15:13:01 +1100 Subject: [PATCH] nixos/suricata: avoid IFD in config generation --- .../services/networking/suricata/default.nix | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/nixos/modules/services/networking/suricata/default.nix b/nixos/modules/services/networking/suricata/default.nix index 8c14b84e3f84..8619109ac452 100644 --- a/nixos/modules/services/networking/suricata/default.nix +++ b/nixos/modules/services/networking/suricata/default.nix @@ -32,18 +32,18 @@ in configFile = mkOption { type = types.path; visible = false; - default = pkgs.writeTextFile { - name = "suricata.yaml"; - text = '' - %YAML 1.1 - --- - ${builtins.readFile ( - yaml.generate "suricata-settings-raw.yaml" ( + default = + pkgs.runCommand "suricata.yaml" + { + settingsYaml = yaml.generate "suricata-settings-raw.yaml" ( filterAttrsRecursive (name: value: value != null) cfg.settings - ) - )} - ''; - }; + ); + } + '' + echo "%YAML 1.1" > $out + echo "---" >> $out + cat $settingsYaml >> $out + ''; description = '' Configuration file for suricata.