mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 07:29:23 +08:00
services.fail2ban: 整理
This commit is contained in:
@@ -67,7 +67,7 @@ inputs:
|
||||
coturn = {};
|
||||
httpua = {};
|
||||
mirism.enable = true;
|
||||
fail2ban.enable = true;
|
||||
fail2ban = {};
|
||||
wireguard =
|
||||
{
|
||||
enable = true;
|
||||
|
||||
@@ -63,7 +63,7 @@ inputs:
|
||||
httpapi.enable = true;
|
||||
gitea.enable = true;
|
||||
grafana.enable = true;
|
||||
fail2ban.enable = true;
|
||||
fail2ban = {};
|
||||
wireguard =
|
||||
{
|
||||
enable = true;
|
||||
|
||||
@@ -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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user