aboutsummaryrefslogtreecommitdiff
path: root/home-manager/tests/modules/targets-linux
diff options
context:
space:
mode:
authorKaiden Fey <kookie@spacekookie.de>2020-09-21 14:12:32 +0200
committerKatharina Fey <kookie@spacekookie.de>2020-09-21 14:12:32 +0200
commitf80843dd45d7acd563d0a5b014cec3a2ea686fc2 (patch)
tree87189d873d6f932d85f9c1a480462b37d96cd6a5 /home-manager/tests/modules/targets-linux
parente0800985dab8f8ebb4cebdfd7e361fd1fafdb2a7 (diff)
parent9b1b55ba0264a55add4b7b4e022bdc2832b531f6 (diff)
Merge commit '9b1b55ba0264a55add4b7b4e022bdc2832b531f6'
Diffstat (limited to 'home-manager/tests/modules/targets-linux')
-rw-r--r--home-manager/tests/modules/targets-linux/default.nix1
-rw-r--r--home-manager/tests/modules/targets-linux/generic-linux.nix22
2 files changed, 23 insertions, 0 deletions
diff --git a/home-manager/tests/modules/targets-linux/default.nix b/home-manager/tests/modules/targets-linux/default.nix
new file mode 100644
index 00000000000..e13617ccb74
--- /dev/null
+++ b/home-manager/tests/modules/targets-linux/default.nix
@@ -0,0 +1 @@
+{ targets-generic-linux = ./generic-linux.nix; }
diff --git a/home-manager/tests/modules/targets-linux/generic-linux.nix b/home-manager/tests/modules/targets-linux/generic-linux.nix
new file mode 100644
index 00000000000..10481b5e988
--- /dev/null
+++ b/home-manager/tests/modules/targets-linux/generic-linux.nix
@@ -0,0 +1,22 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+{
+ config = {
+ targets.genericLinux = {
+ enable = true;
+ extraXdgDataDirs = [ "/foo" ];
+ };
+
+ nmt.script = ''
+ assertFileExists home-path/etc/profile.d/hm-session-vars.sh
+ assertFileContains \
+ home-path/etc/profile.d/hm-session-vars.sh \
+ 'export XDG_DATA_DIRS="''${NIX_STATE_DIR:-/nix/var/nix}/profiles/default/share:/home/hm-user/.nix-profile/share:/foo''${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS"'
+ assertFileContains \
+ home-path/etc/profile.d/hm-session-vars.sh \
+ '. "${pkgs.nix}/etc/profile.d/nix.sh"'
+ '';
+ };
+}