at master 1.2 kB view raw
1{ lib, ... }: 2{ 3 name = "lemurs-wayland-script"; 4 meta = with lib.maintainers; { 5 maintainers = [ 6 nullcube 7 stunkymonkey 8 ]; 9 }; 10 11 nodes.machine = 12 { lib, config, ... }: 13 { 14 imports = [ ../common/user-account.nix ]; 15 16 # Required for wayland to work with Lemurs 17 services.seatd.enable = true; 18 users.users.alice.extraGroups = [ "seat" ]; 19 20 services.displayManager.lemurs.enable = true; 21 22 programs.sway.enable = true; 23 environment.etc."lemurs/wayland/sway" = { 24 mode = "755"; 25 text = '' 26 #! /bin/sh 27 exec ${lib.getExe config.programs.sway.package} 28 ''; 29 }; 30 }; 31 32 testScript = '' 33 machine.start() 34 35 machine.wait_for_unit("multi-user.target") 36 machine.wait_until_succeeds("pgrep -f 'lemurs.*tty1'") 37 machine.screenshot("postboot") 38 39 with subtest("Log in as alice to Sway"): 40 machine.send_chars("\n") 41 machine.send_chars("alice\n") 42 machine.sleep(1) 43 machine.send_chars("foobar\n") 44 machine.sleep(1) 45 machine.wait_until_succeeds("pgrep -u alice sway") 46 machine.sleep(10) 47 machine.succeed("pgrep -u alice sway") 48 machine.screenshot("postlogin") 49 ''; 50}