6 maintainers = with lib.maintainers; [ OPNA2608 ];
14 ./common/user-account.nix
17 # Seems to very rarely get interrupted by oom-killer
18 virtualisation.memorySize = 2047;
20 test-support.displayManager.auto = {
25 services.xserver.enable = true;
26 services.displayManager.defaultSession = lib.mkForce "miracle-wm";
28 programs.wayland.miracle-wm.enable = true;
30 # To ensure a specific config for the tests
31 systemd.tmpfiles.rules =
33 testConfig = (pkgs.formats.yaml { }).generate "miracle-wm.yaml" {
34 terminal = "env WINIT_UNIX_BACKEND=x11 WAYLAND_DISPLAY= alacritty";
38 restart_on_death = false;
44 "d ${config.users.users.alice.home}/.config 0700 alice users - -"
45 "L ${config.users.users.alice.home}/.config/miracle-wm.yaml - - - - ${testConfig}"
50 test-wayland = "wayland-info | tee /tmp/test-wayland.out && touch /tmp/test-wayland-exit-ok";
51 test-x11 = "glinfo | tee /tmp/test-x11.out && touch /tmp/test-x11-exit-ok";
54 systemPackages = with pkgs; [
62 etc."xdg/foot/foot.ini".text = lib.generators.toINI { } {
64 font = "inconsolata:size=16";
67 foreground = "000000";
68 background = "ffffff";
69 regular2 = foreground;
72 etc."xdg/alacritty/alacritty.yml".text = lib.generators.toYAML { } {
74 normal.family = "Inconsolata";
75 bold.family = normal.family;
76 italic.family = normal.family;
77 bold_italic.family = normal.family;
82 foreground = "0x000000";
83 background = "0xffffff";
86 green = primary.foreground;
92 fonts.packages = [ pkgs.inconsolata ];
101 machine.wait_for_unit("multi-user.target")
103 # Wait for Miriway to complete startup
104 machine.wait_for_file("/run/user/1000/wayland-0")
105 machine.succeed("pgrep miracle-wm")
106 machine.screenshot("miracle-wm_launched")
109 with subtest("wayland client works"):
110 # We let miracle-wm start the first terminal, as we might get stuck if it's not ready to process the first keybind
111 # machine.send_key("ctrl-alt-t")
112 machine.wait_for_text("alice@machine")
113 machine.send_chars("test-wayland\n")
114 machine.wait_for_file("/tmp/test-wayland-exit-ok")
115 machine.copy_from_vm("/tmp/test-wayland.out")
116 machine.screenshot("foot_wayland_info")
117 machine.send_chars("exit\n")
118 machine.wait_until_fails("pgrep foot")
121 with subtest("x11 client works"):
122 machine.send_key("meta_l-ret")
123 machine.wait_for_text("alice@machine")
124 machine.send_chars("test-x11\n")
125 machine.wait_for_file("/tmp/test-x11-exit-ok")
126 machine.copy_from_vm("/tmp/test-x11.out")
127 machine.screenshot("alacritty_glinfo")
128 machine.send_chars("exit\n")
129 machine.wait_until_fails("pgrep alacritty")