diff --git a/nixos/modules/notnft.nix b/nixos/modules/notnft.nix index 1eb04e8..06dd260 100644 --- a/nixos/modules/notnft.nix +++ b/nixos/modules/notnft.nix @@ -10,7 +10,8 @@ let optionalAttrs listToAttrs optional - filter; + filter + optionalString; cfg = config.networking.notnft; jsonFormat = (pkgs.formats.json {}); in @@ -115,7 +116,7 @@ in RemainAfterExit = true; ExecStart = startScript; ExecReload = startScript; - ExecStop = "${pkgs.nftables}/bin/nft flush ruleset"; + ExecStop = optionalString cfg.flush "${pkgs.nftables}/bin/nft flush ruleset"; }; }; };