fixup! darwin/core: simplify fish shell $PATH workaround

This commit is contained in:
Guanran Wang 2024-03-13 01:47:04 +08:00
parent 96ef57ff63
commit 107d7b8ea3
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8

View file

@ -42,8 +42,9 @@
# WORKAROUND: Fix $PATH orders when using Fish shell # WORKAROUND: Fix $PATH orders when using Fish shell
# https://github.com/LnL7/nix-darwin/issues/122#issuecomment-1659465635 # https://github.com/LnL7/nix-darwin/issues/122#issuecomment-1659465635
programs.fish.loginShellInit = let programs.fish.loginShellInit = let
# ["$HOME/.local" "/usr/local"] -> "'$HOME/.local/bin' '/usr/local/bin'" # Double quotes instead of single quotes are necessary
makePath = path: lib.concatMapStringsSep " " (path: lib.escapeShellArg "${path}/bin") path; # ["$HOME/.local" "/usr/local"] -> "\"$HOME/.local/bin' '/usr/local/bin\""
makePath = path: lib.concatMapStringsSep " " (path: "\"${path}/bin\"") path;
in '' in ''
fish_add_path --move --prepend --path ${makePath config.environment.profiles} fish_add_path --move --prepend --path ${makePath config.environment.profiles}
set fish_user_paths $fish_user_paths set fish_user_paths $fish_user_paths