services.fail2ban: 整理

This commit is contained in:
2024-03-24 18:23:50 +08:00
parent beca8ed39c
commit dba0ed975b
3 changed files with 6 additions and 16 deletions

View File

@@ -67,7 +67,7 @@ inputs:
coturn = {};
httpua = {};
mirism.enable = true;
fail2ban.enable = true;
fail2ban = {};
wireguard =
{
enable = true;

View File

@@ -63,7 +63,7 @@ inputs:
httpapi.enable = true;
gitea.enable = true;
grafana.enable = true;
fail2ban.enable = true;
fail2ban = {};
wireguard =
{
enable = true;

View File

@@ -1,19 +1,9 @@
inputs:
{
options.nixos.services.fail2ban = let inherit (inputs.lib) mkOption types; in
options.nixos.services.fail2ban = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = null; };
config = let inherit (inputs.config.nixos.services) fail2ban; in inputs.lib.mkIf (fail2ban != null)
{
enable = mkOption { type = types.bool; default = false; };
services.fail2ban = { enable = true; ignoreIP = [ "127.0.0.0/8" "192.168.0.0/16" "vps6.chn.moe" ]; };
};
config =
let
inherit (inputs.config.nixos.services) fail2ban;
inherit (inputs.lib) mkIf;
in mkIf fail2ban.enable
{
services.fail2ban =
{
enable = true;
ignoreIP = [ "127.0.0.0/8" "192.168.0.0/16" "vps6.chn.moe" ];
};
};
}