summary refs log tree commit diff
path: root/nixos/modules/services/security/fail2ban.nix
diff options
context:
space:
mode:
authorIzorkin <izorkin@elven.pw>2020-03-17 22:24:48 +0300
committerIzorkin <izorkin@elven.pw>2020-03-18 09:54:19 +0300
commitc75398b10a23fe19408026b455b20a1961af3917 (patch)
treec7d2418c56873f5da5d2612a9643e7c62f706577 /nixos/modules/services/security/fail2ban.nix
parent1e593070cdd8953f2c4f661535684d7aa8783441 (diff)
downloadnixpkgs-c75398b10a23fe19408026b455b20a1961af3917.tar
nixpkgs-c75398b10a23fe19408026b455b20a1961af3917.tar.gz
nixpkgs-c75398b10a23fe19408026b455b20a1961af3917.tar.bz2
nixpkgs-c75398b10a23fe19408026b455b20a1961af3917.tar.lz
nixpkgs-c75398b10a23fe19408026b455b20a1961af3917.tar.xz
nixpkgs-c75398b10a23fe19408026b455b20a1961af3917.tar.zst
nixpkgs-c75398b10a23fe19408026b455b20a1961af3917.zip
nixos/fail2ban: disable work fail2ban without firewall
Diffstat (limited to 'nixos/modules/services/security/fail2ban.nix')
-rw-r--r--nixos/modules/services/security/fail2ban.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/services/security/fail2ban.nix b/nixos/modules/services/security/fail2ban.nix
index cb748c93d24..976b01fd10e 100644
--- a/nixos/modules/services/security/fail2ban.nix
+++ b/nixos/modules/services/security/fail2ban.nix
@@ -216,6 +216,10 @@ in
 
   config = mkIf cfg.enable {
 
+    warnings = mkIf (config.networking.firewall.enable == false || config.networking.nftables.enable == false) [
+      "fail2ban can not be used without a firewall"
+    ];
+
     environment.systemPackages = [ cfg.package ];
 
     environment.etc = {