git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/gdm: Conflict plymouth-quit, but more carefully

To avoid extra flickering on boot, we want GDM to tell Plymouth to quit after GDM takes control of the display. That configuration was reverted in #71065 because it caused ‘nixos-rebuild switch’ to bring down the graphical session. The reason was that if multi-user.target wants plymouth-quit.service which conflicts display-manager.service, then when ‘nixos-rebuild switch’ starts multi-user.target, display-manager.service is stopped so plymouth-quit.service can be started. We avoid this problem by removing WantedBy: multi-user.target from plymouth-quit.service. Signed-off-by: Anders Kaseorg <andersk@mit.edu>

commitda5401e02203b83a20d016b5d873c7bf54e7e84b authorAnders Kaseorg <andersk@mit.edu> dateThu 15 Oct 2020, 01:56 (6 years ago) parent24c9b05
1 file changed+9−3
nixos/modules/services/x11/display-managers/gdm.nix+9−3
nixos/modules/services/x11/display-managers/gdm.nix+9−3
@@ -183,14 +183,20 @@ in
183183 "systemd-udev-settle.service"
184184 ];
185185 systemd.services.display-manager.conflicts = [
186− "getty@tty${gdm.initialVT}.service"
187− # TODO: Add "plymouth-quit.service" so GDM can control when plymouth quits.
188− # Currently this breaks switching configurations while using plymouth.
186+ "getty@tty${gdm.initialVT}.service"
187+ "plymouth-quit.service"
189188 ];
190189 systemd.services.display-manager.onFailure = [
191190 "plymouth-quit.service"
192191 ];
193192
193+ # Prevent nixos-rebuild switch from bringing down the graphical
194+ # session. (If multi-user.target wants plymouth-quit.service which
195+ # conflicts display-manager.service, then when nixos-rebuild
196+ # switch starts multi-user.target, display-manager.service is
197+ # stopped so plymouth-quit.service can be started.)
198+ systemd.services.plymouth-quit.wantedBy = lib.mkForce [];
199+
194200 systemd.services.display-manager.serviceConfig = {
195201 # Restart = "always"; - already defined in xserver.nix
196202 KillMode = "mixed";