aboutsummaryrefslogtreecommitdiff
path: root/home-manager/tests/modules/misc/xsession/basic.nix
blob: 60623d1bf6be44c19c95e5e22d2d852f2d0f223b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ config, lib, pkgs, ... }:

with lib;

{
  config = {
    home.homeDirectory = "/test-home";

    xsession = {
      enable = true;
      windowManager.command = "window manager command";
      importedVariables = [ "EXTRA_IMPORTED_VARIABLE" ];
      initExtra = "init extra commands";
      profileExtra = "profile extra commands";
    };

    nmt.script = ''
      assertFileExists home-files/.xprofile
      assertFileContent \
        home-files/.xprofile \
        ${./basic-xprofile-expected.txt}

      assertFileExists home-files/.xsession
      assertFileContent \
        home-files/.xsession \
        ${./basic-xsession-expected.txt}

      assertFileExists home-files/.config/systemd/user/setxkbmap.service
      assertFileContent \
        home-files/.config/systemd/user/setxkbmap.service \
        ${pkgs.substituteAll {
          src = ./basic-setxkbmap-expected.service;
          inherit (pkgs.xorg) setxkbmap;
        }}
    '';
  };
}