nixos/networkd: allow byte values to be integers
This commit is contained in:
parent
eae1f31968
commit
2223312e3d
@ -99,8 +99,9 @@ in rec {
|
|||||||
l = reverseList (stringToCharacters s);
|
l = reverseList (stringToCharacters s);
|
||||||
suffix = head l;
|
suffix = head l;
|
||||||
nums = tail l;
|
nums = tail l;
|
||||||
in elem suffix (["K" "M" "G" "T"] ++ digits)
|
in builtins.isInt s
|
||||||
&& all (num: elem num digits) nums;
|
|| (elem suffix (["K" "M" "G" "T"] ++ digits)
|
||||||
|
&& all (num: elem num digits) nums);
|
||||||
|
|
||||||
assertByteFormat = name: group: attr:
|
assertByteFormat = name: group: attr:
|
||||||
optional (attr ? ${name} && ! isByteFormat attr.${name})
|
optional (attr ? ${name} && ! isByteFormat attr.${name})
|
||||||
|
Loading…
Reference in New Issue
Block a user