git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/fail2ban: add options to enable work service with iptables-compat
182012eIzorkin
nixos/modules/services/security/fail2ban.nix+8−2
@@ -55,6 +55,13 @@ in
55 description = "The fail2ban package to use for running the fail2ban service.";
55 description = "The fail2ban package to use for running the fail2ban service.";
56 };
56 };
57
57
58+ packageFirewall = mkOption {
59+ default = pkgs.iptables;
60+ type = types.package;
61+ example = "pkgs.nftables";
62+ description = "The firewall package used by fail2ban service.";
63+ };
64+
58 daemonConfig = mkOption {
65 daemonConfig = mkOption {
59 default = ''
66 default = ''
60 [Definition]
67 [Definition]
@@ -103,7 +110,6 @@ in
103
110
104 };
111 };
105
112
106−
107 ###### implementation
113 ###### implementation
108
114
109 config = mkIf cfg.enable {
115 config = mkIf cfg.enable {
@@ -131,7 +137,7 @@ in
131 restartTriggers = [ fail2banConf jailConf pathsConf ];
137 restartTriggers = [ fail2banConf jailConf pathsConf ];
132 reloadIfChanged = true;
138 reloadIfChanged = true;
133
139
134− path = [ cfg.package pkgs.iptables pkgs.iproute ];
140+ path = [ cfg.package cfg.packageFirewall pkgs.iproute ];
135
141
136 preStart = ''
142 preStart = ''
137 mkdir -p /var/lib/fail2ban
143 mkdir -p /var/lib/fail2ban