Skip to content

Commit

Permalink
nixos/networkd: allow byte values to be integers (#353460)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvishJerricco authored Nov 3, 2024
2 parents f9d1d5f + 2223312 commit 878e1e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nixos/lib/systemd-lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ in rec {
l = reverseList (stringToCharacters s);
suffix = head l;
nums = tail l;
in elem suffix (["K" "M" "G" "T"] ++ digits)
&& all (num: elem num digits) nums;
in builtins.isInt s
|| (elem suffix (["K" "M" "G" "T"] ++ digits)
&& all (num: elem num digits) nums);

assertByteFormat = name: group: attr:
optional (attr ? ${name} && ! isByteFormat attr.${name})
Expand Down

0 comments on commit 878e1e7

Please sign in to comment.