Hi I know this is probably a super noob question, but I have trawled the web and the forums with no luck… and its super annoying hah. Anyways, I am trying to set my default shell to ZSH, when I login to a new session initially it starts with ZSH but then if I close and open any subsequent terminals following this it will revert to BASH. I have set my default shell (according to the https://nixos.wiki/wiki/Command_Shell). I have set up my configuration.nix file with the below:
That’s a good point, I have just had a look through and there is no mention of bash in my home-manager config, system configuration file. Is there somewhere that it might be getting set by default? At this point in time my set up is pretty vanilla as I am just getting familiar with NixOS so apart from my flake file pulling it all together those two files are pretty much all I have.
What happens when you are in a new terminal and just run zsh? Does it launch zsh correctly in that case? Or does it switch to bash? In the latter case, I would assume there might be a stray .zshrc file sitting in your home directory.
Also, just as a sanity-check, what does the following command return?
Aha! Yes, that shouldn’t be the case. shell = pkgs.zsh should change this to zsh. This part of your configuration looks ok, so I assume it’s not applied properly for some reason.
How are you invoking nixos-rebuild? Please post the full command you run.
Hmmm, that looks 100% fine. No overlays either, so nothing that could change the value of pkgs.zsh. And you’re not getting any errors, only building the system configuration..., right?
Ok, so to bisect this further, let’s ensure the activation script is working properly. Run the following commands:
This is the output on my machine (if I replace jarcha98 with my username), but on yours it is probably /run/current-system/sw/bin/bash. Can you confirm that?
Thanks all for your suggestions, I really appreciate the help. Looks like I might have managed to figure out the issue inadvertently whilst looking at a different issue, long story short… looks like it was something to do with a block of code I had sitting in configuration.nix:
when the first line xdg_config_home is set to $HOME/etc, it was throwing everything off including zsh. Anyways, so when I set back to .config its picking up all my configs properly now