Repository navigation
Open
Labels
0.kind: enhancementAdd something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: GNOMEGNOME desktop environment and its underlying platform6.topic: systemdSoftware suite that provides an array of system components for Linux operating systems.
Description
In GNOME 49, GDM started to default to using systemd-userdbd to dynamically create users for each greeter instance. Unfortunately, I did not manage to make it work in time so I had to resort to hardcoding the greeter users:
nixpkgs/nixos/modules/services/display-managers/gdm.nix
Lines 189 to 222 in 4639179
| users.users.gdm-greeter = { | |
| isSystemUser = true; | |
| uid = 60578; | |
| group = "gdm"; | |
| home = "/run/gdm"; | |
| }; | |
| users.users.gdm-greeter-1 = { | |
| isSystemUser = true; | |
| uid = 60579; | |
| group = "gdm"; | |
| home = "/run/gdm-1"; | |
| }; | |
| users.users.gdm-greeter-2 = { | |
| isSystemUser = true; | |
| uid = 60580; | |
| group = "gdm"; | |
| home = "/run/gdm-2"; | |
| }; | |
| users.users.gdm-greeter-3 = { | |
| isSystemUser = true; | |
| uid = 60581; | |
| group = "gdm"; | |
| home = "/run/gdm-3"; | |
| }; | |
| users.users.gdm-greeter-4 = { | |
| isSystemUser = true; | |
| uid = 60582; | |
| group = "gdm"; | |
| home = "/run/gdm-4"; | |
| }; |
Tested with systemd 257.9 and #205121 but it always failed on various PAM issues.
Reacted by David Neugebauer, 那温度, peigongdsd, Jonas Kuche, Yinfeng, Skye Soss, zroug, Suraj, Gergő Gutyina, Srylax and 2 more
Metadata
Metadata
Assignees
Labels
0.kind: enhancementAdd something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: GNOMEGNOME desktop environment and its underlying platform6.topic: systemdSoftware suite that provides an array of system components for Linux operating systems.
Activity
gepbird commentedon Dec 19, 2025
Maybe this is responsible for
gdm-greeterrunning user services, can that be avoided somehow?Start a gnome machine with the above config, when you get to the display manager, go into a tty and check
ps aux | grep sleep. On GNOME 49 there's a sleep process owned bygdm-greeter, while previously there was no process created.(If this issue is unrelated, then definitely something else from #440720 causes it.)
nikamarisa commentedon May 9, 2026
The root cause is that queries of the shadow database bypass nsncd/nscd. On NixOS this means such queries are not aware of the NSS modules defined in
config.system.nssModules.path, which includes nss_systemd.This means pam_unix's helper binary unix_chkpwd can't find the dynamic greeter users.
To solve this, one can
/run/wrappers/bin/unix_chkpwdto a wrapped version which addsconfig.system.nssModules.pathtoLD_LIBRARY_PATHI have been using the both approaches on 25.11, the first from early December until mid February, and the second one since then.
There might be minor parts missing in these examples, since i've extracted them from my configuration but they should work as is.
with wrapped
unix_chkpwdwith a PAM module
(Using this patch pam_sduserdb-no-passwd-log.patch)
on 25.11
In case of NixOS 25.11, where #420889 isn't available, it's necessary override
security.pam.services.gdm-launch-environment.textdirectly withRegarding the patch
Strictly speaking pam_sduserdb-no-passwd-log.patch isn't required for GDM, but if someone was to use the unpatched PAM module in an
authrule instead of anaccountrule, it would log the entered password into the system journal.nixos/gdm: use systemd-userdbd to allocate `gdm-greeter` users
nixos/gdm: use systemd-userdbd to allocate `gdm-greeter` users
nekowinston commentedon May 13, 2026
Quick update for 26.05, summarizing a chat I had with @emilazy and @ElvishJerricco on Matrix:
I think we figured out a path forward to enable systemd-userdbd by default after 26.05. We'd have to address a couple of issues (e.g. nixbld users being classified as regular users rather than system users), and doing that in a rush could cause more problems (how would those changes interact with userborn/systemd-homed/etc); so we'll go ahead with the workaround in #517777 for 26.05.
I'm currently running
staging-next+#517777 on my system and haven't encountered any issues from that, but I honestly also don't quite understand why it's needed. 🤔 Strange, but if it helps us ship gnome 50 in time, I guess it'll work.Also thanks again to @nikamarisa for the super helpful comment above. For a bit of context of why I went with the PAM security wrapper in my PR:
nixpkgs/pkgs/README.md
Line 65 in 8eff708
I'm sure
pam_sduserdbis fine, but the more conservative solution to me seemed to be to makeunix_chkpwdwork like it does on other distributions.nikamarisa commentedon May 13, 2026
That might be because when GDM creates greeter users on demand, it will create their home directory as
/run/gdm/home/gdm-greeter{,-2,-3,-4,-5}and so on. It also create agdm.confin.config/environment.d/in the users home.So it might be worth a try to just change our greeter users home directories to be in the same place.
Since this is only an issue if systemd-userdb is used, one could omit the nixbld users from
/etc/passwdand instead create drop-in files as describes in nss-systemd(8).Such JSON user records can be explicitly marked as system users via their
dispositionfield.nekowinston commentedon May 13, 2026
wow that also works, but hadn't occurred to me. thanks. 😄
and what you said about migrating from /etc/passwd to nss-systemd is what we'll do long-term, as i understand it, it'd just be too rushed before the release.
emilazy commentedon May 13, 2026
I’ve commented at some length about this in #519148 (review).