Skip to content

Commit

Permalink
fish: source NixOS environment on non-login shells, when it hasn't been
Browse files Browse the repository at this point in the history
sourced
(this fixes issue #25789:
#25789 (comment) and
the issue with git-annex mentioned here
#24314 (comment) )
  • Loading branch information
Patrick Callahan committed May 20, 2017
1 parent 9f6b1dc commit 3f91e0d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkgs/shells/fish/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ let
'';

fishPreInitHooks = ''
# source nixos environment if we're a login shell
# source nixos environment
# note that this is required:
# 1. For all shells, not just login shells (mosh needs this as do some other command-line utilities)
# 2. Before the shell is initialized, so that config snippets can find the commands they use on the PATH
builtin status --is-login
or test -z "$__fish_nixos_env_preinit_sourced" -a -z "$ETC_PROFILE_SOURCED" -a -z "$ETC_ZSHENV_SOURCED"
and test -f /etc/fish/nixos-env-preinit.fish
and source /etc/fish/nixos-env-preinit.fish
and set -gx __fish_nixos_env_preinit_sourced 1
test -n "$NIX_PROFILES"
and begin
Expand Down

0 comments on commit 3f91e0d

Please sign in to comment.