diff options
author | Florian Klink <flokli@flokli.de> | 2023-10-04 11:36:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 11:36:16 +0300 |
commit | 42f2e2daddab11a555b94cc97287017851f98a91 (patch) | |
tree | 1e658d0bbbb67966d8622b1e42335e0255da2397 /nixos/lib | |
parent | 8d301f41a14f734dfe8de047ada0f0a68b4f80e3 (diff) | |
parent | 27d0a8a0cda0a178f5b04afb434a8bef47c84cda (diff) |
Merge pull request #257510 from ign0tus/fix/wake-on-lan-policy
Fix: WakeOnLan policy
Diffstat (limited to 'nixos/lib')
-rw-r--r-- | nixos/lib/systemd-lib.nix | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/lib/systemd-lib.nix b/nixos/lib/systemd-lib.nix index f6535b5140659..5669aae0bc19e 100644 --- a/nixos/lib/systemd-lib.nix +++ b/nixos/lib/systemd-lib.nix @@ -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."; |