I have been trying to develop a project using a nix flake.
I have been specifying what I need within the shell in my flake.nix, then entering the environment with `nix develop .`, then launching my editor (nvim).
However, when launching a shell from within my editor, I get prompt breakage and no autocomplete, because the $SHELL variable inside the environment is set to noninteractive bash.
I have simplified this down to simply attempting to launch a nested shell within the environment, which causes the same breakage.
I have attempted to set the $SHELL in the flake in many ways, from specifying `shell = pkgs.bashInteractive` to using a shell hook to manually set the SHELL, all to no avail.
Am I doing something wrong here?
Should I be trying to set the SHELL at all?
Developing inside the shell at all?
If there is an idiomatic way to do it, what is it?
Youād think adding bashInteractive to the shell would be enough, but no. The SHELL env var seems to be set to noninteractive bash, even in that case.
Hmm, I think this is still correct behavior. zsh is only executed as a command, it isnāt the shell that is required to build the derivation. SHELL should point to the shell that the package derivation uses as its shell (which usually is bash).
The main case I ran into is where make uses SHELL to execute its sub-commands. The Makefile expects the shell to be the one defined in the derivation. Not nushell/fish that are likely incompatible with the commands in Makefile.
My case is essentially identical, just replacing zshwith bash-interactive
The thread then resolves saying that this isnāt such a big issue, since allowing SHELL to point to another shell than what the derivation expects could cause builds to fail.
Thereās also the experience of someone else being told to use direnv for this, and failing.
So basically setting the SHELL to something custom is straight up not supported without changing the derivation itself.