summary refs log tree commit diff
path: root/nixos/lib/qemu-flags.nix
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2020-04-20 12:01:24 +0200
committerBas van Dijk <v.dijk.bas@gmail.com>2020-07-20 13:09:27 +0200
commit0410f5dff9ff952bfe129e522933c4c4ef6b3815 (patch)
treeaab75c381fe9d7cf724613958c134b0d529273be /nixos/lib/qemu-flags.nix
parent00022fbeda385d7b6ae2eee44f07eecfc6d92015 (diff)
nixos/tests: support up to 255 nodes in NixOS tests
Diffstat (limited to 'nixos/lib/qemu-flags.nix')
-rw-r--r--nixos/lib/qemu-flags.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/lib/qemu-flags.nix b/nixos/lib/qemu-flags.nix
index 859d9e975fec7..b310914d36cc2 100644
--- a/nixos/lib/qemu-flags.nix
+++ b/nixos/lib/qemu-flags.nix
@@ -2,7 +2,11 @@
 { pkgs }:
 
 let
-  zeroPad = n: if n < 10 then "0${toString n}" else toString n;
+  zeroPad = n:
+    pkgs.lib.optionalString (n < 16) "0" +
+      (if n > 255
+       then throw "Can't have more than 255 nets or nodes!"
+       else pkgs.lib.toHex n);
 in
 
 {