diff --git a/lib/testing.nix b/lib/testing.nix index f70cf9a7e71e..ca0b72972512 100644 --- a/lib/testing.nix +++ b/lib/testing.nix @@ -138,7 +138,28 @@ rec { origArgs = attrs.args; origBuilder = attrs.builder; }); - + + runInMachineWithX = args : + let + client = + { config, pkgs, ... }: + { + virtualisation.memorySize = 1024; + services.xserver.enable = true; + services.xserver.displayManager.slim.enable = false; + services.xserver.displayManager.auto.enable = true; + services.xserver.windowManager.default = "icewm"; + services.xserver.windowManager.icewm.enable = true; + services.xserver.desktopManager.default = "none"; + }; + in + runInMachine ({ + machine = client; + preBuild = '' + $client->waitForX ; + '' ; + } // args ); + simpleTest = as: (apply ({ ... }: as)).test; }