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: add patch to fix $PATH for nix-darwin #352666

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions pkgs/shells/fish/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,20 @@ let
hash = "sha256-YUyfVkPNB5nfOROV+mu8NklCe7g5cizjsRTTu8GjslA=";
};

patches = [
# We don’t want to run `/usr/libexec/path_helper` on nix-darwin,
# as it pulls in paths not tracked in the system configuration
# and messes up the order of `$PATH`. Upstream are unfortunately
# unwilling to accept a change for this and have recommended that
# it should be a distro‐specific patch instead.
#
# See:
#
# * <https://github.com/LnL7/nix-darwin/issues/122>
# * <https://github.com/fish-shell/fish-shell/issues/7142>
./nix-darwin-path.patch
];

# Fix FHS paths in tests
postPatch = ''
# src/fish_tests.cpp
Expand Down
12 changes: 12 additions & 0 deletions pkgs/shells/fish/nix-darwin-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/share/config.fish b/share/config.fish
index d85fd1e185..c564e45b27 100644
--- a/share/config.fish
+++ b/share/config.fish
@@ -158,6 +158,7 @@
#
if status --is-login
if command -sq /usr/libexec/path_helper
+ and not set -q __NIX_DARWIN_SET_ENVIRONMENT_DONE
# Adapt construct_path from the macOS /usr/libexec/path_helper
# executable for fish; see
# https://opensource.apple.com/source/shell_cmds/shell_cmds-203/path_helper/path_helper.c.auto.html .