mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 09:29:41 +08:00
This allows fish users to source the `hm-session-vars.fish` if they are not using the generated `config.fish` (which now sources the same file).
1.2 KiB
1.2 KiB
Why are the session variables not set?
Home Manager is only able to set session variables automatically if it manages your Bash, Z shell, or fish shell configuration. To enable such management you use programs.bash.enable, programs.zsh.enable, or programs.fish.enable.
If you don't want to let Home Manager manage your shell then you will
have to manually source the
~/.nix-profile/etc/profile.d/hm-session-vars.sh file in an appropriate
way. In Bash and Z shell this can be done by adding
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
to your .profile and .zshrc files, respectively. The
hm-session-vars.sh file should work in most Bourne-like shells. For
fish shell, it is possible to source it using the foreign-env
plugin or using the builtin
babelfish-translated variables:
fenv source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" > /dev/null
# or
source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.fish"