mirror of
https://github.com/nix-community/home-manager
synced 2024-12-25 03:09:47 +01:00
zsh: source session variables script
This replaces the explicit set within the Z shell `zshenv` file.
This commit is contained in:
parent
803abb58f9
commit
7631921366
1 changed files with 4 additions and 5 deletions
|
@ -11,11 +11,7 @@ let
|
||||||
pluginsDir = if cfg.dotDir != null then
|
pluginsDir = if cfg.dotDir != null then
|
||||||
relToDotDir "plugins" else ".zsh/plugins";
|
relToDotDir "plugins" else ".zsh/plugins";
|
||||||
|
|
||||||
envVars = cfg.sessionVariables // (
|
envVarsStr = config.lib.shell.exportAll cfg.sessionVariables;
|
||||||
if config.home.sessionVariableSetter == "zsh" then config.home.sessionVariables else {}
|
|
||||||
);
|
|
||||||
|
|
||||||
envVarsStr = config.lib.shell.exportAll envVars;
|
|
||||||
|
|
||||||
aliasesStr = concatStringsSep "\n" (
|
aliasesStr = concatStringsSep "\n" (
|
||||||
mapAttrsToList (k: v: "alias ${k}='${v}'") cfg.shellAliases
|
mapAttrsToList (k: v: "alias ${k}='${v}'") cfg.shellAliases
|
||||||
|
@ -249,6 +245,9 @@ in
|
||||||
|
|
||||||
home.file."${relToDotDir ".zshenv"}".text = ''
|
home.file."${relToDotDir ".zshenv"}".text = ''
|
||||||
typeset -U fpath
|
typeset -U fpath
|
||||||
|
${optionalString (config.home.sessionVariableSetter != "pam") ''
|
||||||
|
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||||
|
''}
|
||||||
${envVarsStr}
|
${envVarsStr}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue