Merge pull request #241365 from RaitoBezarius/macaddrs-netdevs

nixos/networkd: support netdev MAC addresses
This commit is contained in:
Florian Klink 2023-07-19 23:03:34 +03:00 committed by GitHub
commit 6f66c57acc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -63,7 +63,12 @@ in rec {
assertMacAddress = name: group: attr:
optional (attr ? ${name} && ! isMacAddress attr.${name})
"Systemd ${group} field `${name}' must be a valid mac address.";
"Systemd ${group} field `${name}' must be a valid MAC address.";
assertNetdevMacAddress = name: group: attr:
optional (attr ? ${name} && (! isMacAddress attr.${name} || attr.${name} != "none"))
"Systemd ${group} field `${name}` must be a valid MAC address or the special value `none`.";
isPort = i: i >= 0 && i <= 65535;

View file

@ -171,7 +171,7 @@ let
"batadv"
])
(assertByteFormat "MTUBytes")
(assertMacAddress "MACAddress")
(assertNetdevMacAddress "MACAddress")
];
sectionVLAN = checkUnitConfig "VLAN" [