Open
Description
Running Nix-Env: Hit environment
was giving the error:
error: creating directory '/tmp/nix-shell-511600-0/nix-shell-515697-0': No such file or directory
I was getting similar errors from tasks running inside of vscode (rust-analyzer, etc...).
I worked around this issue by unsetting the temp dir variables inside of my nix shell:
pkgs.mkShell {
...
shellHook = ''
...
unset TEMP TMP TEMPDIR TMPDIR
'';
}
This comes from nix change here: NixOS/nix#11713
Change is present in nix 2.24.10 and greater.
Also it seems to me that this extension (nix-env-selector) is caching the environment and the way to update it is to run the "hit" command. That wasn't clear from the documentation at all. I thought it would evaluate the shell every time and also keep nix-shell open. I think it runs 'nix-shell ... --run export' and dumps that to a file somewhere. Anyway, not really a problem.