devbox icon indicating copy to clipboard operation
devbox copied to clipboard

Devbox 0.14 breaks zsh `global shellenv` command

Open gcv opened this issue 10 months ago • 2 comments

What happened?

With devbox 0.13.7, devbox global shellenv works fine on zsh. With 0.14, it breaks:

$ ~/.cache/devbox/bin/0.14.0_linux_amd64/devbox global shellenv

Error: We found a /nix directory but nix binary is not in your PATH and we were not able to find it in the usual locations. Your nix installation might be broken. If restarting your terminal or reinstalling nix doesn't work, please create an issue at https://github.com/jetify-com/devbox/issues

$ ~/.cache/devbox/bin/0.13.7_linux_amd64/devbox global shellenv
export COLORTERM=…
# many lines of output snipped

Nix is installed using the Determinate Nix installer. The Nix binary is available at /nix/var/nix/profiles/default/bin/nix. Devbox has no problem finding it with bash, but fails to find it with zsh.

I’ve worked around this by putting a symlink /nix/var/nix/profiles/default/bin/nix in my path, but it’s unclear why this fails on zsh.

Steps to reproduce

  1. Use Devbox 0.14.
  2. /usr/bin/zsh (or whatever)
  3. devbox global shellenv

blows up

Command

global

devbox.json


Devbox version

0.14.0

Nix version

nix (Nix) 2.24.10

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

gcv avatar Feb 19 '25 15:02 gcv