config/modules/base/sshguard/default.nix

25 lines
456 B
Nix
Raw Normal View History

2023-07-26 14:10:22 +03:00
{
config,
lib,
myData,
...
}: {
options.mj.base.sshguard = with lib.types; {
enable = lib.mkOption {
type = bool;
default = true;
};
};
config = lib.mkIf config.mj.base.sshguard.enable {
services.sshguard = {
enable = true;
blocktime = 900;
whitelist = [
"192.168.0.0/16"
myData.tailscale_subnet.cidr
] ++ (lib.catAttrs "publicIP" (lib.attrValues myData.hosts));
2023-07-26 14:10:22 +03:00
};
};
}