1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-04-15 08:46:52 +00:00

home-environment: Stop exporting __HM_SESS_VARS_SOURCED

If the __HM_SESS_VARS_SOURCED is set in environment of parent process,
then the spawned child shell will inherit it, and won't set the
session variables one expects to be set in their home environment

And, I don't see any need for exporting environment variable, just
setting it is enough for it to be a guard.
This commit is contained in:
Ashish SHUKLA 2021-09-13 10:12:54 +05:30
parent 0912d26b30
commit 32d4829d3f
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

View file

@ -552,7 +552,7 @@ in
text = ''
# Only source this once.
if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi
export __HM_SESS_VARS_SOURCED=1
__HM_SESS_VARS_SOURCED=1
${config.lib.shell.exportAll cfg.sessionVariables}
'' + lib.optionalString (cfg.sessionPath != [ ]) ''

View file

@ -1,6 +1,6 @@
# Only source this once.
if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi
export __HM_SESS_VARS_SOURCED=1
__HM_SESS_VARS_SOURCED=1
@exportLocaleVar@
export V1="v1"
export V2="v2-v1"

View file

@ -7,7 +7,7 @@ let
linuxExpected = ''
# Only source this once.
if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi
export __HM_SESS_VARS_SOURCED=1
__HM_SESS_VARS_SOURCED=1
export LOCALE_ARCHIVE_2_27="${config.i18n.glibcLocales}/lib/locale/locale-archive"
export V1="v1"
@ -21,7 +21,7 @@ let
darwinExpected = ''
# Only source this once.
if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi
export __HM_SESS_VARS_SOURCED=1
__HM_SESS_VARS_SOURCED=1
export V1="v1"
export V2="v2-v1"