What does loginShell do?
Inspecting the code, I could not find what loginShell is used for except for tmux. For context, I'm trying to make macOS load the nix-darwin zsh instead of the system one, with an existing user (not created through nix-darwin).
I have tried:
programs.zsh = {
enable = true;
};
environment.variables = {
SHELL = "${pkgs.zsh}/bin/zsh";
};
environment.loginShell = "${pkgs.zsh}/bin/zsh -l";
The only way to make it work is to either chsh or something like whats done in dscl . -create '/Users/${v.name}' UserShell '${v.shell}'.
I think it would be great if https://github.com/LnL7/nix-darwin/blob/master/modules/users/default.nix#L152-L168 did set the shell even if the user already exists.
The only reference I see to environment.loginShell right now is programs.tmux.defaultCommand uses it. It is rather surprising how there is something called environment.loginShell that doesn't actually affect your overall environment, and only affects tmux (and isn't even doing that very well, it should be overriding the default-shell config value, not default-command).
Given this, I'd suggest that environment.loginShell should ideally be deleted entirely (and let tmux just have the default behavior, which means it'll inherit the user's shell; it can expose a defaultShell option instead to let people override default-shell if they're going to use tmux as their login shell). Granted, this is a compatibility hazard if anyone is using it in their local setup, so instead we could deprecate it, and update the description to explain that it doesn't really affect anything.
Any update to this? I assumed this option would do something like chsh for me which is incorrect. This is quite misleading.
Also see #328
The documentation is extremely misleading,