-
-
Notifications
You must be signed in to change notification settings - Fork 19k
gdm: use systemd-userdbd #519148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging-next
Are you sure you want to change the base?
gdm: use systemd-userdbd #519148
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,22 +25,6 @@ let | |
| exec "$@" | ||
| ''; | ||
|
|
||
| # Solves problems like: | ||
| # https://wiki.archlinux.org/index.php/Talk:Bluetooth_headset#GDMs_pulseaudio_instance_captures_bluetooth_headset | ||
| # Instead of blacklisting plugins, we use Fedora's PulseAudio configuration for GDM: | ||
| # https://src.fedoraproject.org/rpms/gdm/blob/master/f/default.pa-for-gdm | ||
| pulseConfig = pkgs.writeText "default.pa" '' | ||
| load-module module-device-restore | ||
| load-module module-card-restore | ||
| load-module module-udev-detect | ||
| load-module module-native-protocol-unix | ||
| load-module module-default-device-restore | ||
| load-module module-always-sink | ||
| load-module module-intended-roles | ||
| load-module module-suspend-on-idle | ||
| load-module module-position-event-sounds | ||
| ''; | ||
|
|
||
|
Comment on lines
-28
to
-43
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do this and the corresponding tmpfiles settings get removed in “nixos/gdm: use systemd-userdbd to allocate
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Users need to use If we want to keep supporting this config for the minority of users opting out of pipewire-by-default, we'd have to somehow create those files after their homes are allocated. I don't mind if we somehow keep it working, but I didn't want to have dead code sticking around that wasn't doing anything. and I'll clean up the commits.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yeah I don’t think we need to support Pulse here (or at all really). I just wasn’t sure why it was in that commit. |
||
| defaultSessionName = config.services.displayManager.defaultSession; | ||
|
|
||
| setSessionScript = pkgs.callPackage ../x11/display-managers/account-service-util.nix { }; | ||
|
|
@@ -188,33 +172,7 @@ in | |
|
|
||
| services.xserver.displayManager.lightdm.enable = false; | ||
|
|
||
| users.users = lib.mkMerge [ | ||
| { | ||
| gdm = { | ||
| name = "gdm"; | ||
| uid = config.ids.uids.gdm; | ||
| group = "gdm"; | ||
| description = "GDM user"; | ||
| }; | ||
|
|
||
| gdm-greeter = { | ||
| isSystemUser = true; | ||
| uid = 60578; | ||
| group = "gdm"; | ||
| home = "/run/gdm"; | ||
| }; | ||
| } | ||
|
|
||
| (lib.genAttrs' [ 1 2 3 4 ] ( | ||
| i: | ||
| lib.nameValuePair "gdm-greeter-${toString i}" { | ||
| isSystemUser = true; | ||
| uid = 60578 + i; | ||
| group = "gdm"; | ||
| home = "/run/gdm-${toString i}"; | ||
| } | ||
| )) | ||
| ]; | ||
| services.userdbd.enable = true; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could perhaps use a comment, and I wonder if we shouldn’t put this in I suppose it’d have to be “as well”, since you can use GDM without GNOME. But it seems plausible that other GNOME components will begin to want this too, as they move off AccountsService, if they haven’t already. |
||
|
|
||
| users.groups.gdm.gid = config.ids.gids.gdm; | ||
|
|
||
|
|
@@ -248,25 +206,16 @@ in | |
| GDM_X_SESSION_WRAPPER = "${xSessionWrapper}"; | ||
| }; | ||
| execCmd = "exec ${gdm}/bin/gdm"; | ||
| preStart = lib.optionalString (defaultSessionName != null) '' | ||
| # Set default session in session chooser to a specified values – basically ignore session history. | ||
| ${setSessionScript}/bin/set-session ${config.services.displayManager.sessionData.autologinSession} | ||
| ''; | ||
| preStart = | ||
| # sleep to avoid a race condition where userdb allocation isn't available yet, and gdm fails to start | ||
| "sleep 1" | ||
|
Comment on lines
+209
to
+211
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is no good. We have to fix the race condition here rather than hacking around it like this. This looks to me like the systemd dependency ordering isn’t quite right. What does the upstream
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, not happy with it, I needed it for my VM to work reliably, without having to restart |
||
| + lib.optionalString (defaultSessionName != null) '' | ||
| # Set default session in session chooser to a specified values – basically ignore session history. | ||
| ${setSessionScript}/bin/set-session ${config.services.displayManager.sessionData.autologinSession} | ||
| ''; | ||
| }; | ||
| }; | ||
|
|
||
| systemd.tmpfiles.rules = [ | ||
| "d /run/gdm/.config 0711 gdm gdm" | ||
| ] | ||
| ++ lib.optionals config.services.pulseaudio.enable [ | ||
| "d /run/gdm/.config/pulse 0711 gdm gdm" | ||
| "L+ /run/gdm/.config/pulse/${pulseConfig.name} - - - - ${pulseConfig}" | ||
| ] | ||
| ++ lib.optionals config.services.gnome.gnome-initial-setup.enable [ | ||
| # Create stamp file for gnome-initial-setup to prevent it starting in GDM. | ||
| "f /run/gdm/.config/gnome-initial-setup-done 0711 gdm gdm - yes" | ||
| ]; | ||
|
|
||
| # Otherwise GDM will not be able to start correctly and display Wayland sessions | ||
| systemd.packages = [ | ||
| gdm | ||
|
|
@@ -286,6 +235,8 @@ in | |
| systemd.services.display-manager.wants = [ | ||
| # Because sd_login_monitor_new requires /run/systemd/machines | ||
| "systemd-machined.service" | ||
| # to allocate dynamic gdm-greeter{-N} users | ||
| "systemd-userdbd.service" | ||
| # setSessionScript wants AccountsService | ||
| "accounts-daemon.service" | ||
|
Comment on lines
240
to
241
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am wondering if our It’s a bit gross in general. Couldn’t we set an autologin session with a dconf setting or drop‐in file or something? (I know this is a bit orthogonal to this PR in general, but it ties in with using the upstream |
||
| ]; | ||
|
|
@@ -294,6 +245,7 @@ in | |
| "rc-local.service" | ||
| "systemd-machined.service" | ||
| "systemd-user-sessions.service" | ||
| "systemd-userdbd.service" | ||
| "plymouth-quit.service" | ||
| "plymouth-start.service" | ||
| ]; | ||
|
|
@@ -397,6 +349,13 @@ in | |
| "gdm" | ||
| ]; | ||
| } | ||
| { | ||
| name = "env"; | ||
| control = "required"; | ||
| modulePath = "${config.security.pam.package}/lib/security/pam_env.so"; | ||
| settings.conffile = "/etc/pam/environment"; | ||
| settings.readenv = 0; | ||
| } | ||
|
Comment on lines
+352
to
+358
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the move here? (Not doubting it, but some detail in the commit message would be great.) |
||
| { | ||
| name = "permit"; | ||
| control = "optional"; | ||
|
|
@@ -445,13 +404,6 @@ in | |
| "gdm" | ||
| ]; | ||
| } | ||
| { | ||
| name = "env"; | ||
| control = "required"; | ||
| modulePath = "${config.security.pam.package}/lib/security/pam_env.so"; | ||
| settings.conffile = "/etc/pam/environment"; | ||
| settings.readenv = 0; | ||
| } | ||
| { | ||
| name = "systemd"; | ||
| control = "optional"; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
LD_LIBRARY_PATHhere makes me a little nervous and I wonder if this can’t be done in a better way. cc @Majiir @LordGrimmauld