aboutsummaryrefslogtreecommitdiff
path: root/scripts/nix-profile.sh.in
diff options
context:
space:
mode:
authorCole Helbling <cole.e.helbling@outlook.com>2023-02-28 10:09:55 -0800
committerCole Helbling <cole.e.helbling@outlook.com>2023-02-28 10:10:20 -0800
commit24eaa086f00a1302d73c6b9b1d4043e7952d0012 (patch)
treef2c1e0b4031febd90031c6cc2c8cba75871c37c4 /scripts/nix-profile.sh.in
parent4489def1b36aeaee2254159efc1c21c868cc8585 (diff)
nix-profile{,-daemon}.sh.in: Allow XDG_STATE_HOME to be unset
One of our CI machines installs Nix via the official script and then sources the nix-profile.sh script to setup the environment. However, it doesn't have XDG_STATE_HOME set, which causes sourcing the script to fail.
Diffstat (limited to 'scripts/nix-profile.sh.in')
-rw-r--r--scripts/nix-profile.sh.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in
index 264d9a8e2..e8af91211 100644
--- a/scripts/nix-profile.sh.in
+++ b/scripts/nix-profile.sh.in
@@ -3,7 +3,7 @@ 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"