From 47f27938e75eecf31621e4ada1c65e5c9d4bf244 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Wed, 4 Mar 2020 23:44:35 +0100 Subject: shorewall: fix RestartTriggers --- nixos/modules/services/networking/shorewall.nix | 5 +++-- nixos/modules/services/networking/shorewall6.nix | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/networking/shorewall.nix b/nixos/modules/services/networking/shorewall.nix index c59a5366915..16383be2530 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 374e407cc7a..e081aedc6c3 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 ]; }; }; -- cgit 1.4.1