nixos/test-driver: fix graphics for VM

`-nographic` should only be set if no display is available. Otherwise,
tools such as `nixos-build-vms(8)` will never open up a graphical
display.
This commit is contained in:
Maximilian Bosch 2021-08-20 12:00:40 +02:00 committed by David Arnold
parent b2e59bcf77
commit 3f63e3ce65

View file

@ -246,7 +246,7 @@ class StartCommand:
) -> str:
display_opts = ""
display_available = any(x in os.environ for x in ["DISPLAY", "WAYLAND_DISPLAY"])
if display_available:
if not display_available:
display_opts += " -nographic"
# qemu options