Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIX_STATE_HOME: unbound variable #11535

Closed
edolstra opened this issue Sep 18, 2024 · 1 comment · Fixed by #11541
Closed

NIX_STATE_HOME: unbound variable #11535

edolstra opened this issue Sep 18, 2024 · 1 comment · Fixed by #11541
Labels
bug regression Something doesn't work anymore release-blocker

Comments

@edolstra
Copy link
Member

Describe the bug

Nix's bash profile script is failing on several platforms: https://hydra.nixos.org/eval/1808904#tabs-still-fail, e.g. https://hydra.nixos.org/build/272876158#tabs-summary:

/home/vagrant/.nix-profile/etc/profile.d/nix.sh: line 6: NIX_STATE_HOME: unbound variable

This was introduced in #11351 (ping @noamraph).

Steps To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

nix-env --version output

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

@noamraph
Copy link
Contributor

Hi, sorry for the regression. The problem seems to be that I used if [ -n "$NIX_STATE_HOME" ] instead of if [ -n "${NIX_STATE_HOME-}" ]. I also changed the conditions at the beginning of the file to this form, as they would probably have caused the same issue if $HOME or $USER weren't defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug regression Something doesn't work anymore release-blocker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants