From 2223312e3d895c6350351665e0bf83f001f06613 Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Sun, 3 Nov 2024 18:26:20 +0000 Subject: [PATCH] nixos/networkd: allow byte values to be integers --- nixos/lib/systemd-lib.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/lib/systemd-lib.nix b/nixos/lib/systemd-lib.nix index ede54318d558..39961f0f25d5 100644 --- a/nixos/lib/systemd-lib.nix +++ b/nixos/lib/systemd-lib.nix @@ -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})