Skip to content
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
2 changes: 1 addition & 1 deletion fish/conf.d/10-core.fish
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ end
set -gx VISUAL "$EDITOR"

if test (uname) = Linux
for nix_profile_bin in /nix/var/nix/profiles/default/bin "$HOME/.nix-profile/bin"
for nix_profile_bin in /nix/var/nix/profiles/default/bin "$HOME/.nix-profile/bin" "$HOME/.local/bin"
if test -d "$nix_profile_bin"
fish_add_path --path --move "$nix_profile_bin"
end
Expand Down
8 changes: 7 additions & 1 deletion fish/tests/w2-core.fish
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,17 @@ chmod +x "$bin/uname"
set -l linux_open_alias (run_fish -c 'functions -q o; and echo defined; or echo absent')
assert_equal "$linux_open_alias" absent 'Linux Fish startup excludes the macOS open alias'

mkdir -p "$home/.nix-profile/bin"
mkdir -p "$home/.local/bin" "$home/.nix-profile/bin"
printf '#!/bin/sh\n' >"$home/.local/bin/w2-local-command"
chmod +x "$home/.local/bin/w2-local-command"
printf '#!/bin/sh\n' >"$home/.nix-profile/bin/w2-profile-command"
chmod +x "$home/.nix-profile/bin/w2-profile-command"
set -l linux_local_command (run_clean_fish -c "source '$xdg/fish/conf.d/10-core.fish'; command -s w2-local-command")
assert_equal "$linux_local_command" "$home/.local/bin/w2-local-command" 'Linux Fish startup resolves commands from the user-local bin directory'
set -l linux_profile_command (run_clean_fish -c "source '$xdg/fish/conf.d/10-core.fish'; command -s w2-profile-command")
assert_equal "$linux_profile_command" "$home/.nix-profile/bin/w2-profile-command" 'Linux Fish startup resolves commands from the user Nix profile'
set -l linux_path (run_clean_fish -c "source '$xdg/fish/conf.d/10-core.fish'; string join '|' \$PATH")
string match -q "$home/.local/bin|$home/.nix-profile/bin|*" "$linux_path"; or fail 'Linux Fish startup orders user-local bin before the user Nix profile'

printf '#!/bin/sh\n[ "$1" = init ] && printf "set -gx W2_STARSHIP_READY 1\\n"\n' >"$bin/starship"
chmod +x "$bin/starship"
Expand Down
Loading