1 { system ? builtins.currentSystem
2 , pkgs ? import ../.. { inherit system; config = { }; }
6 inherit (pkgs.lib) concatMapStrings listToAttrs optionals optionalString;
7 inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
9 hello32 = "${pkgs.pkgsCross.mingw32.hello}/bin/hello.exe";
10 hello64 = "${pkgs.pkgsCross.mingwW64.hello}/bin/hello.exe";
12 makeWineTest = packageSet: exes: variant: rec {
13 name = "${packageSet}-${variant}";
16 meta = with pkgs.lib.maintainers; { maintainers = [ chkno ]; };
18 nodes.machine = { pkgs, ... }: {
19 environment.systemPackages = [ pkgs."${packageSet}"."${variant}" ];
20 virtualisation.diskSize = 800;
24 machine.wait_for_unit("multi-user.target")
25 ${concatMapStrings (exe: ''
26 greeting = machine.succeed(
27 "bash -c 'wine ${exe} 2> >(tee wine-stderr >&2)'"
29 assert 'Hello, world!' in greeting
31 # only the full version contains Gecko, but the error is not printed reliably in other variants
32 + optionalString (variant == "full") ''
34 "fgrep 'Could not find Wine Gecko. HTML rendering will be disabled.' wine-stderr"
41 variants = [ "base" "full" "minimal" "staging" "unstable" "wayland" ];
45 map (makeWineTest "winePackages" [ hello32 ]) variants
46 ++ optionals pkgs.stdenv.hostPlatform.is64bit
47 (map (makeWineTest "wineWowPackages" [ hello32 hello64 ])
48 # This wayland combination times out after spending many hours.
49 # https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.wine.wineWowPackages-wayland.x86_64-linux
50 (pkgs.lib.remove "wayland" variants))