diff --git a/modules/services/security/fail2ban.nix b/modules/services/security/fail2ban.nix index 3c3519a9db7..d90cf8d4471 100644 --- a/modules/services/security/fail2ban.nix +++ b/modules/services/security/fail2ban.nix @@ -98,11 +98,12 @@ in } ]; - jobs.fail2ban = + systemd.services.fail2ban = { description = "Fail2ban intrusion prevention system"; + + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; - startOn = "started networking"; - path = [ pkgs.fail2ban pkgs.iptables ]; preStart = @@ -113,7 +114,7 @@ in mkdir -p /var/run/fail2ban -m 0755 ''; - exec = "fail2ban-server -f"; + serviceConfig.ExecStart = "${pkgs.fail2ban}/bin/fail2ban-server -f"; postStart = ''