about summary refs log tree commit diff
path: root/scripts/nix-profile.sh.in
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-31T11·07+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-31T11·07+0200
commitc9ff3747db50ad31465e0b67ab9d0ffff36d2e86 (patch)
tree6994716481d81a875b42c21be050611aaae460dc /scripts/nix-profile.sh.in
parentc2d27d30cfe000c4adff91e6cbde63c2a5b92b43 (diff)
nix-profile.sh: Don't pollute the environment
Diffstat (limited to 'scripts/nix-profile.sh.in')
-rw-r--r--scripts/nix-profile.sh.in9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in
index 5e01de9515..cfe05c7166 100644
--- a/scripts/nix-profile.sh.in
+++ b/scripts/nix-profile.sh.in
@@ -5,9 +5,9 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
     # Set up the per-user profile.
     # This part should be kept in sync with nixpkgs:nixos/modules/programs/shell.nix
 
-    : ${NIX_LINK:=$HOME/.nix-profile}
+    NIX_LINK=$HOME/.nix-profile
 
-    : ${NIX_USER_PROFILE_DIR:=@localstatedir@/nix/profiles/per-user/$USER}
+    NIX_USER_PROFILE_DIR=@localstatedir@/nix/profiles/per-user/$USER
 
     mkdir -m 0755 -p "$NIX_USER_PROFILE_DIR"
 
@@ -58,8 +58,7 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
 
     # Set up environment.
     # This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
-    export NIX_USER_PROFILE_DIR
-    export NIX_PROFILES="@localstatedir@/nix/profiles/default $NIX_USER_PROFILE_DIR"
+    NIX_PROFILES="@localstatedir@/nix/profiles/default $NIX_USER_PROFILE_DIR"
 
     for i in $NIX_PROFILES; do
         if [ -d "$i/lib/aspell" ]; then
@@ -83,5 +82,5 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
     fi
 
     export PATH="$NIX_LINK/bin:$NIX_LINK/sbin:$__savedpath"
-    unset __savedpath
+    unset __savedpath NIX_LINK NIX_USER_PROFILE_DIR NIX_PROFILES
 fi