Skip to content

Commit 02e6286

Browse files
authored
Merge pull request #12414 from ilya-bobyr/fish-profile-daemon-XDG_DATA_DIRS
nix-profile-daemon.fish: XDG_DATA_DIRS: .profile/share
2 parents 5c6785e + 85aa624 commit 02e6286

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/nix-profile-daemon.fish.in

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,21 @@ function add_path --argument-names new_path
2121
end
2222

2323
# Main configuration
24+
25+
# Set up the per-user profile.
26+
27+
set NIX_LINK $HOME/.nix-profile
28+
29+
# Set up environment.
30+
# This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
2431
set --export NIX_PROFILES "@localstatedir@/nix/profiles/default $HOME/.nix-profile"
2532

2633
# Populate bash completions, .desktop files, etc
2734
if test -z "$XDG_DATA_DIRS"
2835
# According to XDG spec the default is /usr/local/share:/usr/share, don't set something that prevents that default
29-
set --export XDG_DATA_DIRS "/usr/local/share:/usr/share:/nix/var/nix/profiles/default/share"
36+
set --export XDG_DATA_DIRS "/usr/local/share:/usr/share:$NIX_LINK/share:/nix/var/nix/profiles/default/share"
3037
else
31-
set --export XDG_DATA_DIRS "$XDG_DATA_DIRS:/nix/var/nix/profiles/default/share"
38+
set --export XDG_DATA_DIRS "$XDG_DATA_DIRS:$NIX_LINK/share:/nix/var/nix/profiles/default/share"
3239
end
3340

3441
# Set $NIX_SSL_CERT_FILE so that Nixpkgs applications like curl work.
@@ -56,7 +63,8 @@ else
5663
end
5764

5865
add_path "@localstatedir@/nix/profiles/default/bin"
59-
add_path "$HOME/.nix-profile/bin"
66+
add_path "$NIX_LINK/bin"
67+
set --erase NIX_LINK
6068

6169
# Cleanup
6270

0 commit comments

Comments
 (0)