nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ pkgs, ... }:
2
3{
4 name = "plasma5-systemd-start";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ oxalica ];
7 };
8
9 nodes.machine =
10 { ... }:
11
12 {
13 imports = [ ./common/user-account.nix ];
14 services.xserver = {
15 enable = true;
16 desktopManager.plasma5.enable = true;
17 desktopManager.plasma5.runUsingSystemd = true;
18 };
19
20 services.displayManager = {
21 sddm.enable = true;
22 defaultSession = "plasma";
23 autoLogin = {
24 enable = true;
25 user = "alice";
26 };
27 };
28 };
29
30 testScript =
31 { nodes, ... }:
32 ''
33 with subtest("Wait for login"):
34 start_all()
35 machine.wait_for_file("/tmp/xauth_*")
36 machine.succeed("xauth merge /tmp/xauth_*")
37
38 with subtest("Check plasmashell started"):
39 machine.wait_until_succeeds("pgrep plasmashell")
40 machine.wait_for_window("^Desktop ")
41
42 status, result = machine.systemctl('--no-pager show plasma-plasmashell.service', user='alice')
43 assert status == 0, 'Service not found'
44 assert 'ActiveState=active' in result.split('\n'), 'Systemd service not active'
45 '';
46}