home-manager: include hm-session-vars.sh in activation script

The activation script should active the new environment. The new
environments variable are not available yet.
Source the environment file when activating
This commit is contained in:
Daniel Poelzleithner 2023-10-16 21:13:15 +02:00
parent 78125bc681
commit a8ac7d88b2
3 changed files with 5 additions and 4 deletions

View file

@ -551,7 +551,7 @@ in
destination = "/etc/profile.d/hm-session-vars.sh"; destination = "/etc/profile.d/hm-session-vars.sh";
text = '' text = ''
# Only source this once. # Only source this once.
if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi if [ -n "''${__HM_SESS_VARS_SOURCED-}" ]; then return; fi
export __HM_SESS_VARS_SOURCED=1 export __HM_SESS_VARS_SOURCED=1
${config.lib.shell.exportAll cfg.sessionVariables} ${config.lib.shell.exportAll cfg.sessionVariables}
@ -715,6 +715,7 @@ in
export PATH="${activationBinPaths}" export PATH="${activationBinPaths}"
${config.lib.bash.initHomeManagerLib} ${config.lib.bash.initHomeManagerLib}
source ${config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh
${builtins.readFile ./lib-bash/activation-init.sh} ${builtins.readFile ./lib-bash/activation-init.sh}

View file

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

View file

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