1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
5 maintainers = with lib.maintainers; [ OPNA2608 ];
8 nodes.machine = { config, ... }: {
11 ./common/user-account.nix
14 # Seems to very rarely get interrupted by oom-killer
15 virtualisation.memorySize = 2047;
17 test-support.displayManager.auto = {
22 services.xserver.enable = true;
23 services.displayManager.defaultSession = lib.mkForce "miriway";
28 add-wayland-extensions=all
31 ctrl-alt=t:foot --maximized
32 ctrl-alt=a:env WINIT_UNIX_BACKEND=x11 WAYLAND_DISPLAY= alacritty --option window.startup_mode=\"maximized\"
34 shell-component=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY
36 shell-component=foot --maximized
42 test-wayland = "wayland-info | tee /tmp/test-wayland.out && touch /tmp/test-wayland-exit-ok";
43 test-x11 = "glinfo | tee /tmp/test-x11.out && touch /tmp/test-x11-exit-ok";
46 systemPackages = with pkgs; [
54 etc."xdg/foot/foot.ini".text = lib.generators.toINI { } {
56 font = "inconsolata:size=16";
59 foreground = "000000";
60 background = "ffffff";
61 regular2 = foreground;
64 etc."xdg/alacritty/alacritty.yml".text = lib.generators.toYAML { } {
66 normal.family = "Inconsolata";
67 bold.family = normal.family;
68 italic.family = normal.family;
69 bold_italic.family = normal.family;
74 foreground = "0x000000";
75 background = "0xffffff";
78 green = primary.foreground;
84 fonts.packages = [ pkgs.inconsolata ];
89 testScript = { nodes, ... }: ''
91 machine.wait_for_unit("multi-user.target")
93 # Wait for Miriway to complete startup
94 machine.wait_for_file("/run/user/1000/wayland-0")
95 machine.succeed("pgrep miriway-shell")
96 machine.screenshot("miriway_launched")
99 # We let Miriway start the first terminal, as we might get stuck if it's not ready to process the first keybind
100 # machine.send_key("ctrl-alt-t")
101 machine.wait_for_text(r"(alice|machine)")
102 machine.send_chars("test-wayland\n")
103 machine.wait_for_file("/tmp/test-wayland-exit-ok")
104 machine.copy_from_vm("/tmp/test-wayland.out")
105 machine.screenshot("foot_wayland_info")
106 # Only succeeds when a mouse is moved inside an interactive session?
107 # machine.send_chars("exit\n")
108 # machine.wait_until_fails("pgrep foot")
109 machine.succeed("pkill foot")
112 machine.send_key("ctrl-alt-a")
113 machine.wait_for_text(r"(alice|machine)")
114 machine.send_chars("test-x11\n")
115 machine.wait_for_file("/tmp/test-x11-exit-ok")
116 machine.copy_from_vm("/tmp/test-x11.out")
117 machine.screenshot("alacritty_glinfo")
118 # Only succeeds when a mouse is moved inside an interactive session?
119 # machine.send_chars("exit\n")
120 # machine.wait_until_fails("pgrep alacritty")
121 machine.succeed("pkill alacritty")