From 50300772e4ee1de7a86451533eaad1d988847abb Mon Sep 17 00:00:00 2001 From: Illia Bobyr Date: Mon, 13 Jan 2025 19:12:24 -0800 Subject: [PATCH] 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. --- scripts/nix-profile-daemon.fish.in | 3 +-- scripts/nix-profile.fish.in | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/nix-profile-daemon.fish.in b/scripts/nix-profile-daemon.fish.in index 21a26da7c..2ecab0077 100644 --- a/scripts/nix-profile-daemon.fish.in +++ b/scripts/nix-profile-daemon.fish.in @@ -24,7 +24,7 @@ end # Set up the per-user profile. -set NIX_LINK $HOME/.nix-profile +set --local NIX_LINK $HOME/.nix-profile # Set up environment. # 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 "$NIX_LINK/bin" -set --erase NIX_LINK # Cleanup diff --git a/scripts/nix-profile.fish.in b/scripts/nix-profile.fish.in index 53ad8efd0..05d9a187d 100644 --- a/scripts/nix-profile.fish.in +++ b/scripts/nix-profile.fish.in @@ -24,7 +24,7 @@ end # Set up the per-user profile. -set NIX_LINK $HOME/.nix-profile +set --local NIX_LINK $HOME/.nix-profile # Set up environment. # This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix @@ -63,7 +63,6 @@ if set --query MANPATH end add_path "$NIX_LINK/bin" -set --erase NIX_LINK # Cleanup