Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "zsh: move sessionVariables from .zshrc to .zshenv (nix-commun…
Browse files Browse the repository at this point in the history
…ity#2708)"

This reverts commit 2116fe6.
jwiegley committed Jan 18, 2024
1 parent b84191d commit 7bc6213
Showing 2 changed files with 7 additions and 16 deletions.
17 changes: 4 additions & 13 deletions modules/programs/zsh.nix
Original file line number Diff line number Diff line change
@@ -523,19 +523,6 @@ in
'';
})

{
home.file."${relToDotDir ".zshenv"}".text = ''
# Environment variables
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
# Only source this once
if [[ -z "$__HM_ZSH_SESS_VARS_SOURCED" ]]; then
export __HM_ZSH_SESS_VARS_SOURCED=1
${envVarsStr}
fi
'';
}

{
home.packages = [ cfg.package ]
++ optional cfg.enableCompletion pkgs.nix-zsh-completions
@@ -588,6 +575,10 @@ in
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
}
# Environment variables
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
${envVarsStr}
${optionalString cfg.oh-my-zsh.enable ''
# oh-my-zsh extra settings for plugins
${cfg.oh-my-zsh.extraConfig}
6 changes: 3 additions & 3 deletions tests/modules/programs/zsh/session-variables.nix
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@ with lib;
test.stubs.zsh = { };

nmt.script = ''
assertFileExists home-files/.zshenv
assertFileRegex home-files/.zshenv 'export V1="v1"'
assertFileRegex home-files/.zshenv 'export V2="v2-v1"'
assertFileExists home-files/.zshrc
assertFileRegex home-files/.zshrc 'export V1="v1"'
assertFileRegex home-files/.zshrc 'export V2="v2-v1"'
'';
};
}

0 comments on commit 7bc6213

Please sign in to comment.