mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
bash: source session variables script
This replaces the explicit set within the Bash profile file.
This commit is contained in:
parent
a3250dfac7
commit
803abb58f9
1 changed files with 6 additions and 11 deletions
|
@ -131,16 +131,7 @@ in
|
||||||
map (v: "shopt -s ${v}") cfg.shellOptions
|
map (v: "shopt -s ${v}") cfg.shellOptions
|
||||||
);
|
);
|
||||||
|
|
||||||
# If Bash is the session variable setter then this is the
|
sessionVarsStr = config.lib.shell.exportAll cfg.sessionVariables;
|
||||||
# attribute set of global session variables, otherwise it is an
|
|
||||||
# empty set.
|
|
||||||
globalEnvVars =
|
|
||||||
optionalAttrs
|
|
||||||
(config.home.sessionVariableSetter == "bash")
|
|
||||||
config.home.sessionVariables;
|
|
||||||
|
|
||||||
envVarsStr =
|
|
||||||
config.lib.shell.exportAll (cfg.sessionVariables // globalEnvVars);
|
|
||||||
|
|
||||||
historyControlStr =
|
historyControlStr =
|
||||||
concatStringsSep "\n" (mapAttrsToList (n: v: "${n}=${v}") (
|
concatStringsSep "\n" (mapAttrsToList (n: v: "${n}=${v}") (
|
||||||
|
@ -185,7 +176,11 @@ in
|
||||||
home.file.".profile".text = ''
|
home.file.".profile".text = ''
|
||||||
# -*- mode: sh -*-
|
# -*- mode: sh -*-
|
||||||
|
|
||||||
${envVarsStr}
|
${optionalString (config.home.sessionVariableSetter != "pam") ''
|
||||||
|
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||||
|
''}
|
||||||
|
|
||||||
|
${sessionVarsStr}
|
||||||
|
|
||||||
${cfg.profileExtra}
|
${cfg.profileExtra}
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue