Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

What does loginShell do? #361

Open
pecigonzalo opened this issue Sep 22, 2021 · 3 comments
Open

What does loginShell do? #361

pecigonzalo opened this issue Sep 22, 2021 · 3 comments

Comments

@pecigonzalo
Copy link

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.

@lilyball
Copy link
Contributor

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.

@PhotonQuantum
Copy link
Contributor

Any update to this? I assumed this option would do something like chsh for me which is incorrect. This is quite misleading.

@bestlem
Copy link

bestlem commented Jan 23, 2023

Also see #328

The documentation is extremely misleading,

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants