nixos-config/services/fail2ban.nix

28 lines
422 B
Nix
Raw Normal View History

2022-04-10 11:54:58 +02:00
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
2022-01-11 16:08:21 +01:00
mkEnableOption
mkIf
2022-04-10 11:54:58 +02:00
;
2022-01-11 16:08:21 +01:00
2021-02-22 15:07:29 +01:00
cfg = config.my.services.fail2ban;
in {
options.my.services.fail2ban = {
enable = mkEnableOption "Enable fail2ban";
};
config = mkIf cfg.enable {
2021-02-22 16:18:14 +01:00
services.fail2ban = {
enable = true;
bantime = "6h";
2021-02-22 16:18:14 +01:00
bantime-increment.enable = true;
jails.DEFAULT.settings.findtime = "6h";
2021-02-22 16:18:14 +01:00
};
2021-02-22 15:07:29 +01:00
};
}