Skip to content

Commit

Permalink
Merge pull request #288 from r-burns/fish-fenv
Browse files Browse the repository at this point in the history
fish: fix fenv function path
  • Loading branch information
LnL7 committed Feb 17, 2021
2 parents c8be627 + 771f01c commit 034600c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/programs/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ let

fenv = pkgs.fishPlugins.foreign-env or pkgs.fish-foreign-env;

# fishPlugins.foreign-env and fish-foreign-env have different function paths
fenvFunctionsDir = if (pkgs ? fishPlugins.foreign-env)
then "${fenv}/share/fish/vendor_functions.d"
else "${fenv}/share/fish-foreign-env/functions";

sourceEnv = file:
if cfg.useBabelfish then
"source /etc/fish/${file}.fish"
else
''
set fish_function_path ${fenv}/share/fish-foreign-env/functions $fish_function_path
set fish_function_path ${fenvFunctionsDir} $fish_function_path
fenv source /etc/fish/foreign-env/${file} > /dev/null
set -e fish_function_path[1]
'';
Expand Down Expand Up @@ -167,7 +172,7 @@ in
else ''
# This happens before $__fish_datadir/config.fish sets fish_function_path, so it is currently
# unset. We set it and then completely erase it, leaving its configuration to $__fish_datadir/config.fish
set fish_function_path ${fenv}/share/fish-foreign-env/functions $__fish_datadir/functions
set fish_function_path ${fenvFunctionsDir} $__fish_datadir/functions
# source the NixOS environment config
if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]
Expand Down

0 comments on commit 034600c

Please sign in to comment.