services.fail2ban: init

This commit is contained in:
2023-11-21 20:44:31 +08:00
parent 84a2bc2eac
commit 04d411d16f
3 changed files with 18 additions and 0 deletions

View File

@@ -286,6 +286,7 @@
coturn.enable = true;
httpua.enable = true;
mirism.enable = true;
fail2ban.enable = true;
};
};})
];
@@ -352,6 +353,7 @@
mastodon.enable = true;
gitlab.enable = true;
grafana.enable = true;
fail2ban.enable = true;
};
};})
];

View File

@@ -37,6 +37,7 @@ inputs:
./mastodon.nix
./gitlab.nix
./grafana.nix
./fail2ban.nix
];
options.nixos.services = let inherit (inputs.lib) mkOption types; in
{

View File

@@ -0,0 +1,15 @@
inputs:
{
options.nixos.services.fail2ban = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
};
config =
let
inherit (inputs.config.nixos.services) fail2ban;
inherit (inputs.lib) mkIf;
in mkIf fail2ban.enable
{
services.fail2ban.enable = true;
};
}