mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-02 19:49:18 +00:00
Zsh reads .zshenv before system login startup files. On NixOS and macOS those later files can replace or reorder PATH, so home.sessionPath entries loaded from .zshenv may disappear or move behind system paths. Keep .zshenv coverage for non-login shells, but source Home Manager session variables from .zprofile for login shells so PATH-like values are applied after system login setup. Fixes #2991
25 lines
595 B
Nix
25 lines
595 B
Nix
{ config, ... }:
|
|
|
|
{
|
|
programs.zsh = {
|
|
enable = true;
|
|
|
|
sessionVariables = {
|
|
PATH = "$HOME/bin:$PATH";
|
|
V1 = "v1";
|
|
V2 = "v2-${config.programs.zsh.sessionVariables.V1}";
|
|
IS_EMPTY = "";
|
|
IS_NULL = null;
|
|
IS_FALSE = false;
|
|
IS_TRUE = true;
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.zshenv
|
|
assertFileContent $(normalizeStorePaths home-files/.zshenv) ${./session-variables.zshenv}
|
|
assertFileExists home-files/.zprofile
|
|
assertFileContent $(normalizeStorePaths home-files/.zprofile) ${./session-variables.zprofile}
|
|
'';
|
|
}
|