Skip to content

nixos/gdm: update gdm-greeter user homes, add warning for pulseaudio#521789

Merged
bobby285271 merged 3 commits into
NixOS:masterfrom
nekowinston:gdm/fix-permissions-and-accessibility
May 23, 2026
Merged

nixos/gdm: update gdm-greeter user homes, add warning for pulseaudio#521789
bobby285271 merged 3 commits into
NixOS:masterfrom
nekowinston:gdm/fix-permissions-and-accessibility

Conversation

@nekowinston

@nekowinston nekowinston commented May 19, 2026

Copy link
Copy Markdown
Member

This fixes gdm not being able to save config changes made on the log-in screen, such as turning on accessibility options.
ibus-daemon also currently coredumps multiple times when gdm starts because of the write protected home directory, which this PR also fixes.
The previous workaround with the special pam env file is no longer needed; as was suggested in #458058 (comment)

There's more info in the commit messages too :)

Things done

@nekowinston nekowinston mentioned this pull request May 19, 2026
13 tasks
@nixpkgs-ci nixpkgs-ci Bot requested a review from a team May 19, 2026 02:37
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels May 19, 2026
@vcunat vcunat changed the base branch from staging-next to master May 20, 2026 11:52
@nixpkgs-ci nixpkgs-ci Bot closed this May 20, 2026
@nixpkgs-ci nixpkgs-ci Bot reopened this May 20, 2026
@nekowinston nekowinston force-pushed the gdm/fix-permissions-and-accessibility branch from 4fa32ac to 674298d Compare May 21, 2026 01:00
This fixes gdm not being able to save config changes made on the log-in
screen, such as turning on accessibility options. The new values for the
`gdm-greeter{-2,-3,-4,-5}` users map onto what userdbd would create for us.
We need writable home directories to interact with `dbus`, as well as to
populate the `/run/gdm/home/gdm-greeter/.config/environment.d/` files.

`gnome-inital-setup-done` is now seemingly called `gdm.ran-initial-setup`:
https://gitlab.gnome.org/GNOME/gdm/-/blob/gnome-50/daemon/gdm-manager.c?ref_type=heads#L64
@nekowinston nekowinston force-pushed the gdm/fix-permissions-and-accessibility branch from 674298d to 9320dc9 Compare May 21, 2026 15:50
@nekowinston nekowinston changed the title nixos/gdm: define gdm-greeter user homes nixos/gdm: update gdm-greeter user homes, add warning for pulseaudio May 21, 2026
We plan to use systemd-userdbd for NixOS 26.11, which will dynamically
allocate greeter users + their homes, which would break the current PA
config. GNOME already depends on PipeWire in other places, so there's
little reason to keep this around.
@nekowinston nekowinston force-pushed the gdm/fix-permissions-and-accessibility branch from 9320dc9 to 82ed78a Compare May 23, 2026 10:14
@nekowinston nekowinston added the 6.topic: accessibility Make things in Nixpkgs usable by as many people of varying ability as possible label May 23, 2026
@nekowinston

Copy link
Copy Markdown
Member Author

@bobby285271 sorry for the ping, but could you give this a try? the current config on nixos-unstable causes accessibility issues or at least unnecessary coredumps & journal logs.

@bobby285271 bobby285271 added this pull request to the merge queue May 23, 2026

@bobby285271 bobby285271 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, works for me.

Merged via the queue into NixOS:master with commit 83934ee May 23, 2026
50 of 51 checks passed
@nekowinston nekowinston deleted the gdm/fix-permissions-and-accessibility branch May 24, 2026 20:55
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/weird-gdm-greeter-n-warnings-since-nix-flake-update/77915/3


config = lib.mkIf cfg.enable {

warnings = lib.optional config.services.pulseaudio.enable "Support for Pulseaudio + gdm will be removed in NixOS 26.11";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My NixOS setup strongly depends on pipewire & pulseaudio working together (See also #353789 ), and I wish to keep this setup and hopefully not have to switch to a different desktop manager. Hence I wonder: Why using systemd-userdbd makes it impossible to use pulseaudio with GDM? Also, maybe we can live fine with gdm not being able to play audio with pulseaudio, and we don't have to disallow this during evaluation.

@nekowinston nekowinston Jun 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be poorly worded, my plan wasn't to disallow evaluation of gdm+pulse; but I don't know if we'll be able to keep the workaround of https://github.com/nixos/nixpkgs/blob/82ed78a9ee81eada31b619ebcdbb248daa123b9a/nixos/modules/services/display-managers/gdm.nix#L28-L42 to fix the issues listed in the linked archlinux wiki talk.
I also don't know if these issues are still around almost 10 years later; I just saw Fedora dropped the configuration as well, as they're exclusively supporting pipewire now.

@doronbehar doronbehar Jun 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any reason for this workaround to not work when systemd-userdbd will be used -- the paths of the home directories will be the same. I guess Fedora dropped this because they don't need it for their default setups and because they don't use Nix it is much harder for them to maintain this. Even if we will notice something is broken with gdm+pulse when systemd-userdbd is enabled by default, we can worry about that latter. Please revert the warning 🙏.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create tmpfiles rules for dynamic users?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create tmpfiles rules for dynamic users?

Why not? If I understand correctly, systemd-tmpfiles-setup.service runs when it is aware of all the user's IDs etc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think @nekowinston ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: accessibility Make things in Nixpkgs usable by as many people of varying ability as possible 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants