nixos-config/services/fail2ban.nix

26 lines
419 B
Nix
Raw Normal View History

2021-02-22 15:07:29 +01:00
{ config, lib, pkgs, ... }:
let
2022-01-11 16:08:21 +01:00
inherit (lib)
mkEnableOption
mkIf
;
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-increment.enable = true;
jails.DEFAULT = ''
bantime = 6h
findtime = 6h
'';
};
2021-02-22 15:07:29 +01:00
};
}