caesium: bump

This commit is contained in:
2026-10-17 15:02:53 -04:00
parent 71ae57dd92
commit f41b6186eb
4 changed files with 190 additions and 6 deletions
+8 -6
View File
@@ -34,15 +34,17 @@ let
formatCidrRule = rule: cidr:
let
family = if hasInfix ":" cidr then "ip6" else "ip";
# toString handles both integers (2222) and strings ("8000-8010") cleanly
portStr = toString rule.port;
# toString handles both integers (2222) and strings ("8000-8010") cleanly --
# nftables accepts dash-range syntax directly in a rule statement.
portStr = toString rule.port;
in
"${family} saddr ${cidr} ${rule.protocol} dport ${portStr} accept comment \"${rule.name}\"";
"${family} saddr ${cidr} ${rule.protocol} dport ${portStr} accept comment \"${rule.name}\"";
formatRule = ruleName: rule:
formatRule = _ruleName: rule:
concatMapStringsSep "\n" (formatCidrRule rule) rule.allowedCIDRs;
in {
in
{
options.networking.firewall.restrictedPorts = mkOption {
type = types.attrsOf (types.submodule ruleOpts);
default = { };
@@ -50,7 +52,7 @@ in {
};
config = mkIf (cfg != { }) {
networking.firewall.extraInputRules =
networking.firewall.extraInputRules =
concatMapStringsSep "\n" (ruleName: formatRule ruleName cfg.${ruleName}) (attrNames cfg);
};
}