I recently upgraded nix to the 2.4 release and tried to use the new experimental nix commands after modifying nix.conf.
However, I have been unable to make nix shell work properly. The command succeeds and opens a new shell, however that shell is almost identical to the one I started on. In particular, it does not contain the packages I requested…
I tried running the examples shown in the nix shell help page: opening a new shell does not seem to work, but executing a command in a single line does.
nix shell nixpkgs#hello
nix shell nixpkgs#hello -c hello
Is this intended? Am I misunderstanding something?
(by the way, before the upgrade nix run behaved in the same way, only with it being called nix run I was more confident that it was intended…)
My bash profile only has the line added by the nix installer, my bashrc contains direnv and a few aliases, I suppose it may be something in the profile defaults from the distro (which are sourced at the start of bashrc).
Any idea on how to debug this?
When is too late for the path, anyway? Understandably the distro sets the path, but that is the first line executed in the bashrc…
Does the nix code for preparing the shell execute before or after the shell rc/profiles?
The difference, if I understand the nix code, is that nix shell sets the environment with setenv and then expects the PATH to propagate to the shell/command, while nix develop sets the environment by creating a temporary rc file which contains the global bashrc + the custom nix environment.