summaryrefslogtreecommitdiff
path: root/modules/networkd/systemd-lib.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-10-17 20:58:27 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2021-10-17 20:58:27 +0200
commit610bf85460c1371aa2af035054b7f9d641132388 (patch)
tree5ccb6597ecc10c76f114f7b0c8cf51d64d62a8d4 /modules/networkd/systemd-lib.nix
parent3a2161ef205c432db0053e9a82893069b54e55ed (diff)
downloadnixos-610bf85460c1371aa2af035054b7f9d641132388.tar
nixos-610bf85460c1371aa2af035054b7f9d641132388.tar.gz
nixos-610bf85460c1371aa2af035054b7f9d641132388.tar.bz2
nixos-610bf85460c1371aa2af035054b7f9d641132388.tar.xz
nixos-610bf85460c1371aa2af035054b7f9d641132388.zip
yggdrasil-wg: ...
Diffstat (limited to 'modules/networkd/systemd-lib.nix')
-rw-r--r--modules/networkd/systemd-lib.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/networkd/systemd-lib.nix b/modules/networkd/systemd-lib.nix
index 2dbf1503..c5b5b7cb 100644
--- a/modules/networkd/systemd-lib.nix
+++ b/modules/networkd/systemd-lib.nix
@@ -90,6 +90,10 @@ in rec {
90 optional (attr ? ${name} && !isInt attr.${name}) 90 optional (attr ? ${name} && !isInt attr.${name})
91 "Systemd ${group} field `${name}' is not an integer"; 91 "Systemd ${group} field `${name}' is not an integer";
92 92
93 assertMaxLength = name: max: group: attr:
94 optional (attr ? ${name} && stringLength attr.${name} > max)
95 "Systemd ${group} field `${name}' is too long (max of ${max})";
96
93 checkUnitConfig = group: checks: attrs: let 97 checkUnitConfig = group: checks: attrs: let
94 # We're applied at the top-level type (attrsOf unitOption), so the actual 98 # We're applied at the top-level type (attrsOf unitOption), so the actual
95 # unit options might contain attributes from mkOverride and mkIf that we need to 99 # unit options might contain attributes from mkOverride and mkIf that we need to