3 wayland = { pkgs, ... }: {
4 imports = [ ./common/wayland-cage.nix ];
6 services.cage.program = "${pkgs.vscodium}/bin/codium";
8 environment.variables.NIXOS_OZONE_WL = "1";
9 environment.variables.DISPLAY = "do not use";
11 fonts.packages = with pkgs; [ dejavu_fonts ];
13 xorg = { pkgs, ... }: {
14 imports = [ ./common/user-account.nix ./common/x11.nix ];
16 virtualisation.memorySize = 2047;
17 services.xserver.enable = true;
18 services.xserver.displayManager.sessionCommands = ''
19 ${pkgs.vscodium}/bin/codium
21 test-support.displayManager.auto.user = "alice";
25 mkTest = name: machine:
26 import ./make-test-python.nix ({ pkgs, ... }: {
29 nodes = { "${name}" = machine; };
31 meta = with pkgs.lib.maintainers; {
32 maintainers = [ synthetica turion ];
39 machine.succeed('pgrep -x codium')
44 machine.wait_for_unit('graphical.target')
46 codium_running.wait() # type: ignore[union-attr]
47 with codium_running: # type: ignore[union-attr]
48 # Wait until vscodium is visible. "File" is in the menu bar.
49 machine.wait_for_text('Welcome')
50 machine.screenshot('start_screen')
52 test_string = 'testfile'
55 machine.send_key('ctrl-n')
56 machine.wait_for_text('Untitled')
57 machine.screenshot('empty_editor')
60 machine.send_chars(test_string)
61 machine.wait_for_text(test_string)
62 machine.screenshot('editor')
65 machine.send_key('ctrl-s')
66 machine.wait_for_text('(Save|Desktop|alice|Size)')
67 machine.screenshot('save_window')
68 machine.send_key('ret')
70 # (the default filename is the first line of the file)
71 machine.wait_for_file(f'/home/alice/{test_string}')
73 # machine.send_key('ctrl-q')
74 # machine.wait_until_fails('pgrep -x codium')
79 builtins.mapAttrs (k: v: mkTest k v) tests