mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
networkd: Allow combinations of WakeOnLan policies
To comply with the systemd.link WakeOnLan[^1] specification, the option "off" and all other possible policy combinations must be allowed. [^1]: https://www.freedesktop.org/software/systemd/man/systemd.link.html#WakeOnLan=
This commit is contained in:
parent
d76e8633bf
commit
237f7ba7d2
2 changed files with 5 additions and 1 deletions
|
@ -80,6 +80,10 @@ in rec {
|
|||
optional (attr ? ${name} && !elem attr.${name} values)
|
||||
"Systemd ${group} field `${name}' cannot have value `${toString attr.${name}}'.";
|
||||
|
||||
assertValuesSomeOfOr = name: values: default: group: attr:
|
||||
optional (attr ? ${name} && !(all (x: elem x values) (splitString " " attr.${name}) || attr.${name} == default))
|
||||
"Systemd ${group} field `${name}' cannot have value `${toString attr.${name}}'.";
|
||||
|
||||
assertHasField = name: group: attr:
|
||||
optional (!(attr ? ${name}))
|
||||
"Systemd ${group} field `${name}' must exist.";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue