Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fish: fix fenv function path #288

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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