From 6c0ab2edd5b1dc43bb598bc6180eba79d9d5e5da Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Thu, 23 Apr 2026 09:42:48 +0100 Subject: [PATCH 1/4] nixos-test-driver: only depend on vsock things on linux --- nixos/lib/test-driver/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/lib/test-driver/default.nix b/nixos/lib/test-driver/default.nix index 69ba17863012..32b2c1af2587 100644 --- a/nixos/lib/test-driver/default.nix +++ b/nixos/lib/test-driver/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonApplication, colorama, @@ -59,7 +60,6 @@ buildPythonApplication { socat util-linux vde2 - vhost-device-vsock ] ++ lib.optionals enableNspawn [ systemd @@ -67,6 +67,9 @@ buildPythonApplication { ++ lib.optionals enableOCR [ imagemagick_light tesseract4 + ] + ++ lib.optionals stdenv.isLinux [ + vhost-device-vsock ]; # containers test requires extra nix features that are not available in ofborg. From 6668b5b381513861cc2bdeb3f0318e94d484196f Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Thu, 23 Apr 2026 09:43:05 +0100 Subject: [PATCH 2/4] nixos-test-driver: use hostPkgs to write config files to store --- nixos/lib/testing/driver-configuration.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/lib/testing/driver-configuration.nix b/nixos/lib/testing/driver-configuration.nix index 36e512f94f6b..222332d51fad 100644 --- a/nixos/lib/testing/driver-configuration.nix +++ b/nixos/lib/testing/driver-configuration.nix @@ -1,7 +1,7 @@ { config, lib, - pkgs, + hostPkgs, ... }: let @@ -75,9 +75,9 @@ in ) (lib.attrValues config.nodes ++ lib.attrValues config.containers) ); global_timeout = config.globalTimeout; - test_script = pkgs.writeText "test-script" config.testScriptString; + test_script = hostPkgs.writeText "test-script" config.testScriptString; enable_ssh_backdoor = config.sshBackdoor.enable; }; - driverConfigurationFile = pkgs.writers.writeJSON "driverConfiguration.json" config.driverConfiguration; + driverConfigurationFile = hostPkgs.writers.writeJSON "driverConfiguration.json" config.driverConfiguration; }; } From 133e3555ff1fda82966707d9502e0af3c81f2f8b Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Thu, 23 Apr 2026 10:55:49 +0100 Subject: [PATCH 3/4] nixos-test-driver: only use sharedMemory qemu config setting on linux --- nixos/lib/testing/driver.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/lib/testing/driver.nix b/nixos/lib/testing/driver.nix index c6802d61dd43..40584b10e00d 100644 --- a/nixos/lib/testing/driver.nix +++ b/nixos/lib/testing/driver.nix @@ -9,6 +9,8 @@ let inherit (config) sshBackdoor; + inherit (hostPkgs.stdenv.hostPlatform) isLinux; + # Reifies and correctly wraps the python test driver for # the respective qemu version and with or without ocr support testDriver = config.pythonTestDriverPackage.override { @@ -251,7 +253,7 @@ in # depending on whether debugging is enabled. # # If needed, this can still be turned off. - virtualisation.qemu.enableSharedMemory = lib.mkDefault true; + virtualisation.qemu.enableSharedMemory = lib.mkDefault isLinux; assertions = [ { From ea9c3ae589bdb113a62367ff84c244fe30bc0b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 23 Apr 2026 14:43:46 +0200 Subject: [PATCH 4/4] nixos-test-driver: reduce unnecessary rebuilds for now --- nixos/lib/test-driver/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/lib/test-driver/default.nix b/nixos/lib/test-driver/default.nix index 32b2c1af2587..77638397d11c 100644 --- a/nixos/lib/test-driver/default.nix +++ b/nixos/lib/test-driver/default.nix @@ -61,15 +61,15 @@ buildPythonApplication { util-linux vde2 ] + ++ lib.optionals stdenv.isLinux [ + vhost-device-vsock + ] ++ lib.optionals enableNspawn [ systemd ] ++ lib.optionals enableOCR [ imagemagick_light tesseract4 - ] - ++ lib.optionals stdenv.isLinux [ - vhost-device-vsock ]; # containers test requires extra nix features that are not available in ofborg.