aboutsummaryrefslogtreecommitdiff
path: root/scripts/nix-profile.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/nix-profile.sh.in')
-rw-r--r--scripts/nix-profile.sh.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in
index 264d9a8e2..c4d60cf37 100644
--- a/scripts/nix-profile.sh.in
+++ b/scripts/nix-profile.sh.in
@@ -3,12 +3,12 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
# Set up the per-user profile.
NIX_LINK="$HOME/.nix-profile"
- if [ -n "$XDG_STATE_HOME" ]; then
+ if [ -n "${XDG_STATE_HOME-}" ]; then
NIX_LINK_NEW="$XDG_STATE_HOME/nix/profile"
else
NIX_LINK_NEW="$HOME/.local/state/nix/profile"
fi
- if ! [ -e "$NIX_LINK" ]; then
+ if [ -e "$NIX_LINK_NEW" ]; then
NIX_LINK="$NIX_LINK_NEW"
else
if [ -t 2 ] && [ -e "$NIX_LINK_NEW" ]; then