aboutsummaryrefslogtreecommitdiff
path: root/modules/home-environment.nix
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2018-01-04 13:15:22 +0100
committerRobert Helgesson <robert@rycee.net>2018-01-07 17:52:13 +0100
commite624b9aa6a7caf99eaacfd4ffd9c3ef839c68a66 (patch)
tree0292daf00214c574d000daf61669bcae00704b6a /modules/home-environment.nix
parent2fc1b9b5e00e31e23b015b2204840109f4e7fe55 (diff)
home-environment: install `hm-session-vars.sh` file
This is a file containing all session variables exported using a Bourne-compatible syntax.
Diffstat (limited to 'modules/home-environment.nix')
-rw-r--r--modules/home-environment.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/home-environment.nix b/modules/home-environment.nix
index 77850a8e364..66fe430bccd 100644
--- a/modules/home-environment.nix
+++ b/modules/home-environment.nix
@@ -267,6 +267,23 @@ in
//
(maybeSet "LC_TIME" cfg.language.time);
+ home.packages = [
+ # Provide a file holding all session variables.
+ (
+ pkgs.writeTextFile {
+ name = "hm-session-vars.sh";
+ destination = "/etc/profile.d/hm-session-vars.sh";
+ text = ''
+ # Only source this once.
+ if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi
+ export __HM_SESS_VARS_SOURCED=1
+
+ ${config.lib.shell.exportAll cfg.sessionVariables}
+ '';
+ }
+ )
+ ];
+
# A dummy entry acting as a boundary between the activation
# script's "check" and the "write" phases.
home.activation.writeBoundary = dag.entryAnywhere "";