nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ pkgs, ... }:
2
3{
4 name = "plasma5";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ ttuegel ];
7 };
8
9 nodes.machine =
10 { ... }:
11
12 {
13 imports = [ ./common/user-account.nix ];
14 services.xserver.enable = true;
15 services.displayManager.sddm.enable = true;
16 services.displayManager.defaultSession = "plasma";
17 services.xserver.desktopManager.plasma5.enable = true;
18 environment.plasma5.excludePackages = [ pkgs.plasma5Packages.elisa ];
19 services.displayManager.autoLogin = {
20 enable = true;
21 user = "alice";
22 };
23 };
24
25 testScript =
26 { nodes, ... }:
27 let
28 user = nodes.machine.users.users.alice;
29 xdo = "${pkgs.xdotool}/bin/xdotool";
30 in
31 ''
32 with subtest("Wait for login"):
33 start_all()
34 machine.wait_for_file("/tmp/xauth_*")
35 machine.succeed("xauth merge /tmp/xauth_*")
36
37 with subtest("Check plasmashell started"):
38 machine.wait_until_succeeds("pgrep plasmashell")
39 machine.wait_for_window("^Desktop ")
40
41 with subtest("Check that KDED is running"):
42 machine.succeed("pgrep kded5")
43
44 with subtest("Check that logging in has given the user ownership of devices"):
45 machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
46
47 with subtest("Ensure Elisa is not installed"):
48 machine.fail("which elisa")
49
50 machine.succeed("su - ${user.name} -c 'xauth merge /tmp/xauth_*'")
51
52 with subtest("Run Dolphin"):
53 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin >&2 &'")
54 machine.wait_for_window(" Dolphin")
55
56 with subtest("Run Konsole"):
57 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole >&2 &'")
58 machine.wait_for_window("Konsole")
59
60 with subtest("Run systemsettings"):
61 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 >&2 &'")
62 machine.wait_for_window("Settings")
63
64 with subtest("Wait to get a screenshot"):
65 machine.execute(
66 "${xdo} key Alt+F1 sleep 10"
67 )
68 machine.screenshot("screen")
69 '';
70}