From 0f6944200e0199ddaa54647fd1f6dedaa7d8b5bf Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 17 Sep 2026 22:41:23 -0400 Subject: [PATCH] nixos/test-driver: fix GPU Qemu argument condition In 48995a6ef97c08b338838cb37578ef0aa0b46fd9 (#527511), the `isLinux` and `isAarch64` condition were taken from the `hostPkgs`, and not the guest system's `pkgs`. Graphical NixOS tests on aarch64-darwin work with this commit thanks to the removed `isLinux` argument, and the `isAarch64` argument should be taken from the guest's OS, per [qemu's docs][1]: > The recommended option is virtio-gpu-pci; this is the only one which > will work correctly with KVM. You may also need to ensure your guest > kernel is configured with support for this; [1]: https://www.qemu.org/docs/master/system/arm/virt --- nixos/lib/testing/driver.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/lib/testing/driver.nix b/nixos/lib/testing/driver.nix index 31173219f88c..2cdbb72bc5fe 100644 --- a/nixos/lib/testing/driver.nix +++ b/nixos/lib/testing/driver.nix @@ -14,7 +14,7 @@ let inherit (config) sshBackdoor; - inherit (hostPkgs.stdenv.hostPlatform) isLinux isAarch64; + inherit (hostPkgs.stdenv.hostPlatform) isLinux; # Reifies and correctly wraps the python test driver for # the respective qemu version and with or without ocr support @@ -249,7 +249,7 @@ in passthru.driver = config.driver; nodeDefaults = - { config, ... }: + { config, pkgs, ... }: { # This is needed for the SSH backdoor to function. # Set this to `true` by default to not change essential QEMU flags @@ -258,7 +258,7 @@ in # If needed, this can still be turned off. virtualisation.qemu.enableSharedMemory = lib.mkDefault isLinux; # Needed for screenshots to work (in e.g `nixosTests.login`) - virtualisation.qemu.options = lib.optionals (isLinux && isAarch64) [ + virtualisation.qemu.options = lib.optionals pkgs.stdenv.hostPlatform.isAarch64 [ "-device virtio-gpu-pci" ];