about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-03-06 11:58:35 +0100
committerGitHub <noreply@github.com>2020-03-06 11:58:35 +0100
commitdc706339130d34ccb7ce28ca22a496a417f476ea (patch)
tree044ef617d2f295d21025f5126c65a44a1375685b /nixos
parentb791e6cbddeb5762bea2493a256e86f77a004f98 (diff)
parent47f27938e75eecf31621e4ada1c65e5c9d4bf244 (diff)
downloadnixlib-dc706339130d34ccb7ce28ca22a496a417f476ea.tar
nixlib-dc706339130d34ccb7ce28ca22a496a417f476ea.tar.gz
nixlib-dc706339130d34ccb7ce28ca22a496a417f476ea.tar.bz2
nixlib-dc706339130d34ccb7ce28ca22a496a417f476ea.tar.lz
nixlib-dc706339130d34ccb7ce28ca22a496a417f476ea.tar.xz
nixlib-dc706339130d34ccb7ce28ca22a496a417f476ea.tar.zst
nixlib-dc706339130d34ccb7ce28ca22a496a417f476ea.zip
Merge pull request #81774 from ju1m/shorewall_fix_RestartTriggers
shorewall: fix RestartTriggers
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/shorewall.nix5
-rw-r--r--nixos/modules/services/networking/shorewall6.nix5
2 files changed, 6 insertions, 4 deletions
diff --git a/nixos/modules/services/networking/shorewall.nix b/nixos/modules/services/networking/shorewall.nix
index c59a53669158..16383be2530f 100644
--- a/nixos/modules/services/networking/shorewall.nix
+++ b/nixos/modules/services/networking/shorewall.nix
@@ -26,13 +26,14 @@ in {
         description = "The shorewall package to use.";
       };
       configs = lib.mkOption {
-        type        = types.attrsOf types.str;
+        type        = types.attrsOf types.lines;
         default     = {};
         description = ''
           This option defines the Shorewall configs.
           The attribute name defines the name of the config,
           and the attribute value defines the content of the config.
         '';
+        apply = lib.mapAttrs (name: text: pkgs.writeText "${name}" text);
       };
     };
   };
@@ -62,7 +63,7 @@ in {
       '';
     };
     environment = {
-      etc = lib.mapAttrs' (name: conf: lib.nameValuePair "shorewall/${name}" {text=conf;}) cfg.configs;
+      etc = lib.mapAttrs' (name: conf: lib.nameValuePair "shorewall/${name}" {source=conf;}) cfg.configs;
       systemPackages = [ cfg.package ];
     };
   };
diff --git a/nixos/modules/services/networking/shorewall6.nix b/nixos/modules/services/networking/shorewall6.nix
index 374e407cc7a1..e081aedc6c34 100644
--- a/nixos/modules/services/networking/shorewall6.nix
+++ b/nixos/modules/services/networking/shorewall6.nix
@@ -26,13 +26,14 @@ in {
         description = "The shorewall package to use.";
       };
       configs = lib.mkOption {
-        type        = types.attrsOf types.str;
+        type        = types.attrsOf types.lines;
         default     = {};
         description = ''
           This option defines the Shorewall configs.
           The attribute name defines the name of the config,
           and the attribute value defines the content of the config.
         '';
+        apply = lib.mapAttrs (name: text: pkgs.writeText "${name}" text);
       };
     };
   };
@@ -62,7 +63,7 @@ in {
       '';
     };
     environment = {
-      etc = lib.mapAttrs' (name: conf: lib.nameValuePair "shorewall6/${name}" {text=conf;}) cfg.configs;
+      etc = lib.mapAttrs' (name: conf: lib.nameValuePair "shorewall6/${name}" {source=conf;}) cfg.configs;
       systemPackages = [ cfg.package ];
     };
   };