Hello,
Sorry if that question as already been answered, but I could not find any similar topic.
I’m running nix darwin on MacOs.
on nix shell, nix flake, or nix-direnv, after few minutes or few hours, my installed commands are no longer available.
I believe this is due to the garbage collector, but I don’t know how to check of fix that.
Thanks for your help,
TLATER
February 20, 2026, 12:22pm
2
Ferllings:
on nix shell, nix flake, or nix-direnv, after few minutes or few hours, my installed commands are no longer available.
If you use nix shell or direnv to “install” something, it isn’t “installed” in the traditional sense of the word. The application is only present in the shell environment you enter.
If you close your terminal, you have to re-enter the shell to get it back (but nix will not download the binaries again).
If you want to install something permanently, use your nix-darwin config file.
Sorry if I wasn’t clear enough.
I’m using nix-shell for dev context environment:
For example: I install nodejs with a shell.nix config, run some npm commands to launch a webserver, then after a while, if I want to restart the webserver, the npm command is gone, then I have to exit the nix shell and relaunch it.
TLATER
February 20, 2026, 1:51pm
4
Within the same shell? Is something editing your $PATH?
It almost certainly has nothing to do with garbage collection.
Yes, same shell. The $path is not modified (not that I know of)
When it happens, when I restart nix-shell, I can see the bin beeing re-dowloaded:
these 17 paths will be fetched (31.18 MiB download, 174.53 MiB unpacked):
/nix/store/a1r0y3krwckpbhs99dg6pmcrz9958b96-bzip2-1.0.8-bin
/nix/store/wpms1f3gzb5jvypf7k46frsyawc4yan3-diffutils-3.12
/nix/store/halmrsmg98gbphbx7vy7xk5w7mz9mkrn-ed-1.22.4
/nix/store/6zysjbixkd5g1r83qpin7m7lwq4581jx-file-5.45
/nix/store/jx71jsynqq0ywc8z6afhqqaipyj97fbm-gnu-config-2024-01-01
/nix/store/cz4rjcd28s9qqk2zcnn9d8pgs5l6qqy9-gnumake-4.4.1
/nix/store/4jhz97mvip61gn146avpanb60glazgz4-gnutar-1.35
/nix/store/fsjq3v4gimf64wc5xcy7mbwpcgv47j6a-jemalloc-5.3.0-unstable-2025-09-12
/nix/store/ywm49y8ncwny2nr0wvs6vmaxqjiqg523-nodejs-24.13.0-dev
/nix/store/15nxbdvjhw7db9q632pirvr7qb5jbwim-patch-2.8
/nix/store/a0i7dm3y1pdkpjc2p0lj2868iqw1cph2-pnpm-10.28.0
/nix/store/r0nacc31pp9jglw15wacjp8bzyjhi41b-rustup-1.28.2
/nix/store/37klhy4i7c8jwxl61m9dzli9zw8l57j8-sqlx-cli-0.8.6
/nix/store/kadgci668drg4iadff84lqr2dxx1x838-stdenv-darwin
/nix/store/cwsddxmy6xbdczpgrqy2189cq8j91sls-update-autotools-gnu-config-scripts-hook
/nix/store/3vhsffs1rr2vn84f41z8vm3lmya12ig3-uv-0.10.2
/nix/store/qsdbdwkpipxx6kawkph3dmajkw2160p7-xz-5.8.2-bin