nixos/networkd: Add the RoutingPolicyRule-related options

This commit is contained in:
Félix Baylac-Jacqué
2020-03-01 14:52:36 -08:00
committed by Florian Klink
parent 0a8af284e5
commit 611d765b76
2 changed files with 51 additions and 0 deletions
@@ -59,6 +59,11 @@ in rec {
optional (attr ? ${name} && ! isMacAddress attr.${name})
"Systemd ${group} field `${name}' must be a valid mac address.";
isPort = i: i >= 0 && i <= 65535;
assertPort = name: group: attr:
optional (attr ? ${name} && ! isPort attr.${name})
"Error on the systemd ${group} field `${name}': ${attr.name} is not a valid port number.";
assertValueOneOf = name: values: group: attr:
optional (attr ? ${name} && !elem attr.${name} values)