Normal users not appearing in login manager lists

None of my users.users.* entries appear in the list of users for login in any login manager. I currently use lightdm for logging in and my only option is to manually enter my username every time but this is the same in every other login manager. Where have I gone wrong?

It also tells me that no users are listed in gnome-control-center under details > users (says none are found). Yet I am able to log in with all users to see this!

My configuration is available, the users are really basic entries in a separate file with but are very basic and look like: = { isNormalUser = true; };

Other (hopefully) pertinent information:

> nix-shell -p nix-info --run "nix-info -m"                                                        
 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.80, NixOS, 19.09.976.c75de8bc12c (Loris)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3`
 - channels(aloysius): `"home-manager-19.09, nixos-19.09.1019.c5aabb0d603"`
 - channels(root): `"nixos-19.09.976.c75de8bc12c"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

I had the suggestion to nuke /var/lib/AccountsService but doing so and having it regenerate the directory has left the users sub-directory empty. It feels like my users file is being ignored somewhere.

Huge thanks to @worldofpeace and @jtojnar for all their help on IRC.

The users were being skipped by accountsservice because the shells were set to an entry outside of those listed in /etc/shells (see here for what happens).

/var/run has been deprecated (in favour of /run) but not removed from my 19.03 config when pushing to a new 19.09 machine. Recommendation to instead use users.defaultUserShell = pkgs.<preferred-shell> instead of strings containing paths and so my config now does this!


I am using sddm and can log in without issues.

$ cat /etc/shells 

$ echo $SHELL

@peterhoeg you’d only run into the issue if you pointed one of your shells to /var/run. Was that the case?

I was experiencing this same issue and the proposed solutions don’t work.

Two observations: I use zsh, and my /var/lib/AccountsService/users/<user> file seemed to be stuck with SystemAccount=true (when I tried to change it to false, it would reset to its original value after reboot.)

I resolved this by placing the following in my configuration.nix:

environment.shells = with pkgs; [ bashInteractive zsh ];

What this does is updates /etc/shells to contain both bash and zsh as valid login shells. For whatever reason, if a user’s login shell isn’t in this list, GNOME forces it to be treated as a “SystemAccount”.