fix(nftables): empty peeps

This commit is contained in:
arcnmx 2025-10-20 09:31:13 -07:00
parent ceeb079b58
commit 0db7d3b943

View file

@ -15,7 +15,7 @@
hasSops = options ? sops.secrets; hasSops = options ? sops.secrets;
in { in {
options.networking.access.peeps = with lib.types; { options.networking.access.peeps = with lib.types; {
enable = mkEnableOption "peeps" // {default = hasSops;}; enable = mkEnableOption "peeps" // {default = hasSops && cfg.ranges != {};};
ranges = mkOption { ranges = mkOption {
type = attrsOf str; type = attrsOf str;
default = {}; default = {};
@ -57,7 +57,7 @@ in {
firewall.interfaces.peeps = { firewall.interfaces.peeps = {
nftables.enable = cfg.enable; nftables.enable = cfg.enable;
nftables.conditions = [ nftables.conditions = [
(mkIf (cfg.enable && networking.enableIPv6) condition) (mkIf (cfg.enable && networking.enableIPv6 && cfg.ranges != {}) condition)
]; ];
}; };
}; };