Skip to content

Commit 5030077

Browse files
committed
nix-profile.fish: set --local NIX_LINK
Using `set --local` is better than using `set`/`set --erase`. `--local` will preserve any existing `NIX_LINK` value. And the local variable is automatically removed for any execution path.
1 parent 3e8cd2f commit 5030077

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

scripts/nix-profile-daemon.fish.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ end
2424

2525
# Set up the per-user profile.
2626

27-
set NIX_LINK $HOME/.nix-profile
27+
set --local NIX_LINK $HOME/.nix-profile
2828

2929
# Set up environment.
3030
# This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
@@ -64,7 +64,6 @@ end
6464

6565
add_path "@localstatedir@/nix/profiles/default/bin"
6666
add_path "$NIX_LINK/bin"
67-
set --erase NIX_LINK
6867

6968
# Cleanup
7069

scripts/nix-profile.fish.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ end
2424

2525
# Set up the per-user profile.
2626

27-
set NIX_LINK $HOME/.nix-profile
27+
set --local NIX_LINK $HOME/.nix-profile
2828

2929
# Set up environment.
3030
# This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
@@ -63,7 +63,6 @@ if set --query MANPATH
6363
end
6464

6565
add_path "$NIX_LINK/bin"
66-
set --erase NIX_LINK
6766

6867
# Cleanup
6968

0 commit comments

Comments
 (0)