1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-01 08:49:44 +01:00
home-manager/tests/modules/misc/xsession/basic.nix
Robert Helgesson 95b95b1407
tests: improve test purity
Before the XDG variables would be set from the user's environment, if
available. This would break some tests.

With this change the tests should be fully deterministic.

Fixes #1190
2020-04-24 21:46:34 +02:00

40 lines
1,010 B
Nix

{ config, lib, pkgs, ... }:
with lib;
{
config = {
xsession = {
enable = true;
windowManager.command = "window manager command";
importedVariables = [ "EXTRA_IMPORTED_VARIABLE" ];
initExtra = "init extra commands";
profileExtra = "profile extra commands";
};
nixpkgs.overlays = [
(self: super: {
xorg = super.xorg // {
setxkbmap = super.xorg.setxkbmap // { outPath = "@setxkbmap@"; };
};
})
];
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 \
${./basic-setxkbmap-expected.service}
'';
};
}