diff options
author | Robert Helgesson <robert@rycee.net> | 2018-01-04 13:15:22 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2018-01-07 17:52:13 +0100 |
commit | e624b9aa6a7caf99eaacfd4ffd9c3ef839c68a66 (patch) | |
tree | 0292daf00214c574d000daf61669bcae00704b6a /modules/home-environment.nix | |
parent | 2fc1b9b5e00e31e23b015b2204840109f4e7fe55 (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.nix | 17 |
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 ""; |