Zsh not working - /etc/passwd shows "nologin" as shell

I’m not able to install zsh. When i put this configuration

  programs.zsh.enable = true;
  users.defaultUserShell = pkgs.zsh;
  users.users.myuser.useDefaultShell = false;

and restart X I just can’t open a terminal. Going into root in a tty and trying su -c "echo hello" myuser or just trying to login as myuser in tty shows this message:
This account is currently not available

Which is the output of nologin, which is in /etc/passwd:

I tried changing the nologin part to zsh like in other entries, and it works, i can use zsh normally, until reboot, something overwrites it back to nologin after reboot.

When i comment the three lines above, the /etc/passwd goes back to bash

Nevermind, I found out that it was users.users.myuser.useDefaultShell that was causing the breakage. I commented it and now it works

1 Like