1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-14 04:51:08 +01:00
home-manager/modules/programs/zsh
Thiago Kenji Okada 9e0453a9b0 zsh: source session variable file directly
Right now we load `hm-session-vars.sh` from
`config.home.profileDirectory`, generally resulting in the following
code being generated in `zshenv`:

```
. "/etc/profiles/per-user/<username>/etc/profile.d/hm-session-vars.sh"
```

This is problematic in a few situations. For example, when entering a
`distrobox` environment I got the following error:

```
/home/<username>/.zshenv:.:2: no such file or directory: /etc/profiles/per-user/<username>/etc/profile.d/hm-session-vars.sh
```

Instead, let's point to the path directly to the `/nix/store` by using
`config.home.sessionVariablesPackage` instead. This is more robust and
it is more consistent with other things we source in ZSH.
2025-09-30 07:50:26 -05:00
..
plugins zsh/plugins: optimize plugin loading with array-based loops 2025-09-27 13:18:01 -05:00
default.nix zsh: source session variable file directly 2025-09-30 07:50:26 -05:00
deprecated.nix zsh: move deprecated options to separate file 2025-07-12 11:42:00 -05:00
history.nix zsh/history: optimize history options with array-based loops 2025-09-27 13:18:01 -05:00
lib.nix zsh: lib better docstrings 2025-07-28 14:47:42 -05:00