diff options
author | Tobias Happ <tobias.happ@gmx.de> | 2020-04-05 16:46:55 +0200 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2020-04-08 13:36:25 +0200 |
commit | d06bcf4c970e45fa260e992d96160b48712504e6 (patch) | |
tree | 0d5d24762538fb0c018926d03360b5ffc0643b91 /tests/modules | |
parent | dd538c29690898c388dd4ec883a61cf2415b452c (diff) |
targets.genericLinux: add module
PR #797
Diffstat (limited to 'tests/modules')
-rw-r--r-- | tests/modules/targets/default.nix | 1 | ||||
-rw-r--r-- | tests/modules/targets/generic-linux-session-vars-expected.txt | 6 | ||||
-rw-r--r-- | tests/modules/targets/generic-linux.nix | 23 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/modules/targets/default.nix b/tests/modules/targets/default.nix new file mode 100644 index 00000000000..e13617ccb74 --- /dev/null +++ b/tests/modules/targets/default.nix @@ -0,0 +1 @@ +{ targets-generic-linux = ./generic-linux.nix; } diff --git a/tests/modules/targets/generic-linux-session-vars-expected.txt b/tests/modules/targets/generic-linux-session-vars-expected.txt new file mode 100644 index 00000000000..ad9e0ada63f --- /dev/null +++ b/tests/modules/targets/generic-linux-session-vars-expected.txt @@ -0,0 +1,6 @@ +# Only source this once. +if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi +export __HM_SESS_VARS_SOURCED=1 + +export XDG_DATA_DIRS="/nix/var/nix/profiles/default/share:/homeless-shelter/.nix-profile/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS" +. "@nix@/etc/profile.d/nix.sh" diff --git a/tests/modules/targets/generic-linux.nix b/tests/modules/targets/generic-linux.nix new file mode 100644 index 00000000000..2e06b2545d5 --- /dev/null +++ b/tests/modules/targets/generic-linux.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + config = { + home.homeDirectory = "/homeless-shelter"; + + targets.genericLinux.enable = true; + + nmt.script = '' + assertFileExists home-path/etc/profile.d/hm-session-vars.sh + assertFileContent \ + home-path/etc/profile.d/hm-session-vars.sh \ + ${ + pkgs.substituteAll { + src = ./generic-linux-session-vars-expected.txt; + nix = pkgs.nix; + } + } + ''; + }; +} |