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>
wip/yesman
Anders Kaseorg 4 years ago
parent 24c9b05ac5
commit da5401e022
  1. 12
      nixos/modules/services/x11/display-managers/gdm.nix

@ -183,14 +183,20 @@ in
"systemd-udev-settle.service"
];
systemd.services.display-manager.conflicts = [
"getty@tty${gdm.initialVT}.service"
# TODO: Add "plymouth-quit.service" so GDM can control when plymouth quits.
# Currently this breaks switching configurations while using plymouth.
"getty@tty${gdm.initialVT}.service"
"plymouth-quit.service"
];
systemd.services.display-manager.onFailure = [
"plymouth-quit.service"
];
# Prevent nixos-rebuild switch from bringing down the graphical
# session. (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.)
systemd.services.plymouth-quit.wantedBy = lib.mkForce [];
systemd.services.display-manager.serviceConfig = {
# Restart = "always"; - already defined in xserver.nix
KillMode = "mixed";

Loading…
Cancel
Save