From da5401e02203b83a20d016b5d873c7bf54e7e84b Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 15 Oct 2020 01:56:59 -0700 Subject: nixos/gdm: Conflict plymouth-quit, but more carefully MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- nixos/modules/services/x11/display-managers/gdm.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix index eae70a57c781d..f53a4a49a06aa 100644 --- a/nixos/modules/services/x11/display-managers/gdm.nix +++ b/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"; -- cgit 1.4.1