xsession: add option importedVariables

This option lists the environment variables to be imported into the
systemd user session.

Also add a basic test of the xsession module.
This commit is contained in:
Robert Helgesson 2019-06-23 14:06:29 +02:00
parent f83c49baa3
commit 95d55b8da1
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
8 changed files with 96 additions and 9 deletions

View file

@ -0,0 +1,30 @@
{ config, lib, ... }:
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}
'';
};
}