Open undecided opened 8 months ago
I'm having trouble reproducing this one. Do you mind telling me if any of the following paths exist on your system?
ls -l \
"/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh" \
"$HOME/.nix-profile/etc/profile.d/nix.sh" \
"$HOME/.local/state/nix/profile/etc/profile.d/nix.sh" \
"$HOME/.local/state/nix/profiles/profile/etc/profile.d/nix.sh"
What's the output of nix --version --debug
?
Do you see something like the following in /etc/bash.bashrc
or /etc/profile.d/nix.sh
?
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
Also, if you add a verbose flag does it tell you which paths are being removed?
devbox run -- nix store gc --verbose --extra-experimental-features nix-command
Thanks!
❯ ls -l "/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh" "$HOME/.nix-profile/etc/profile.d/nix.sh" "$HOME/.local/state/nix/profile/etc/profile.d/nix.sh" "$HOME/.local/state/nix/profiles/profile/etc/profile.d/nix.sh"
ls: cannot access '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh': No such file or directory
ls: cannot access '/home/matthew/.local/state/nix/profile/etc/profile.d/nix.sh': No such file or directory
-r--r--r-- 1 matthew matthew 2880 Jan 1 1970 /home/matthew/.local/state/nix/profiles/profile/etc/profile.d/nix.sh
-r--r--r-- 1 matthew matthew 2880 Jan 1 1970 /home/matthew/.nix-profile/etc/profile.d/nix.sh
Nix version:
❯ nix --version --debug
nix (Nix) 2.18.1
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/matthew/.config/nix/nix.conf:/etc/xdg/xdg-cinnamon/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/azvn85cras6xv4z5j85fiy406f24r1q0-nix-2.18.1/share
❯ cat /etc/nix/nix.conf
cat: /etc/nix/nix.conf: No such file or directory
Nothing nix related in /etc/
- sudo grep -ir nix /etc/bash* /etc/profile*
gave no results
And with verbose flag:
projects/third_party/devboxplay via impure
❯ devbox run -- nix store gc --verbose --extra-experimental-features nix-command
finding garbage collector roots...
deleting garbage...
deleting '/nix/store/ys6g8wvr5rwxyfqrlvwd7vipj9ysqn70-nss-cacert-3.92'
deleting '/nix/store/hzx954rnda4k348rb4wvqbdzp9z0ynjy-user-environment.drv'
deleting '/nix/store/8xl4kcn7lgaa9chyqwjjsd7xbq842hml-user-environment'
deleting '/nix/store/qa5v8vixm2z468nw49wcvgqiq61dlg8s-env-manifest.nix'
deleting '/nix/store/9kbkm00saz41sxfs6bxmvkb9k4qk495y-nixpkgs-unstable'
deleting '/nix/store/sn54r0d8p033g71s08nhsabhwhl07f5d-source'
deleting '/nix/store/b319178j5b2c7i9xvpnik81881jy11fj-source'
deleting '/nix/store/j0jlb33bm31w347w43051hbffgh616jr-source'
deleting '/nix/store/q9kr7w9lb4b7kxb9p647qzxarjrbr8x0-nix-shell.drv'
deleting unused links...
note: currently hard linking saves 0.00 MiB
9 store paths deleted, 133.72 MiB freed
❯
exit
❯ devbox shell
Error: Unable to find nix startup file. If /nix directory exists it's possible the installation did not complete successfully. Follow instructions at https://nixos.org/download.html for manual install.
What happened?
Found that my nix installation had snowballed to 15gb (I only have a single project using devbox).
Found the documentation how-do-i-clean-up-unused-packages-from-the-nix-store
Ran
devbox run -- nix store gc
Then (after several attempts at different combinations and a couple of web searches) finally found that the command I really wanted wasdevbox run -- nix store gc --extra-experimental-features nix-command
Even with a fresh install of nix and the devbox.json below, I get the message:
After exiting the shell, attempting
devbox shell
produces the following errorSteps to reproduce
devbox shell
or similar to install required packagesdevbox run -- nix store gc --extra-experimental-features nix-command
Command
run, shell
devbox.json
Devbox version
0.9.1
Nix version
nix (Nix) 2.18.1
What system does this bug occur on?
Linux (x86-64)
Debug logs