summary refs log tree commit diff
diff options
context:
space:
mode:
authorMajiir Paktu <majiir@nabaal.net>2023-10-02 21:50:52 -0400
committerMajiir Paktu <majiir@nabaal.net>2023-10-07 16:09:11 -0400
commit088da23f9ea4ed95da0f7842689774c0ab1837a3 (patch)
treedcee0889971b14637f49a3ad9c3e0b7377d9c379
parent679733b3adb6ab06154adb93c345e75fd3f1c2ab (diff)
downloadnixpkgs-088da23f9ea4ed95da0f7842689774c0ab1837a3.tar
nixpkgs-088da23f9ea4ed95da0f7842689774c0ab1837a3.tar.gz
nixpkgs-088da23f9ea4ed95da0f7842689774c0ab1837a3.tar.bz2
nixpkgs-088da23f9ea4ed95da0f7842689774c0ab1837a3.tar.lz
nixpkgs-088da23f9ea4ed95da0f7842689774c0ab1837a3.tar.xz
nixpkgs-088da23f9ea4ed95da0f7842689774c0ab1837a3.tar.zst
nixpkgs-088da23f9ea4ed95da0f7842689774c0ab1837a3.zip
nixos/test-instrumentation: fix unsetting of defaultGateway
The empty string is coerced to an attrset:

    { address = ""; interface = null; metric = null; }

The new defaultGateway logic (correctly) complains that interface must
be defined when using networkd. We instead clear defaultGateway by
setting it to its actual default value, which is null.
-rw-r--r--nixos/modules/testing/test-instrumentation.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix
index 6dc4091bad1..c91e54f5a4d 100644
--- a/nixos/modules/testing/test-instrumentation.nix
+++ b/nixos/modules/testing/test-instrumentation.nix
@@ -128,7 +128,7 @@ in
     boot.consoleLogLevel = 7;
 
     # Prevent tests from accessing the Internet.
-    networking.defaultGateway = mkOverride 150 "";
+    networking.defaultGateway = mkOverride 150 null;
     networking.nameservers = mkOverride 150 [ ];
 
     system.requiredKernelConfig = with config.lib.kernelConfig; [