1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-28 09:28:32 +02:00

home-environment: install hm-session-vars.sh file

This is a file containing all session variables exported using a
Bourne-compatible syntax.
This commit is contained in:
Robert Helgesson 2018-01-04 13:15:22 +01:00
parent 2fc1b9b5e0
commit e624b9aa6a
No known key found for this signature in database
GPG Key ID: C3DB11069E65DC86

View File

@ -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 "";