mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
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.
This commit is contained in:
parent
3e8cd2ffe6
commit
50300772e4
2 changed files with 2 additions and 4 deletions
|
@ -24,7 +24,7 @@ end
|
||||||
|
|
||||||
# Set up the per-user profile.
|
# Set up the per-user profile.
|
||||||
|
|
||||||
set NIX_LINK $HOME/.nix-profile
|
set --local NIX_LINK $HOME/.nix-profile
|
||||||
|
|
||||||
# Set up environment.
|
# Set up environment.
|
||||||
# This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
|
# This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
|
||||||
|
@ -64,7 +64,6 @@ end
|
||||||
|
|
||||||
add_path "@localstatedir@/nix/profiles/default/bin"
|
add_path "@localstatedir@/nix/profiles/default/bin"
|
||||||
add_path "$NIX_LINK/bin"
|
add_path "$NIX_LINK/bin"
|
||||||
set --erase NIX_LINK
|
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ end
|
||||||
|
|
||||||
# Set up the per-user profile.
|
# Set up the per-user profile.
|
||||||
|
|
||||||
set NIX_LINK $HOME/.nix-profile
|
set --local NIX_LINK $HOME/.nix-profile
|
||||||
|
|
||||||
# Set up environment.
|
# Set up environment.
|
||||||
# This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
|
# This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
|
||||||
|
@ -63,7 +63,6 @@ if set --query MANPATH
|
||||||
end
|
end
|
||||||
|
|
||||||
add_path "$NIX_LINK/bin"
|
add_path "$NIX_LINK/bin"
|
||||||
set --erase NIX_LINK
|
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue