about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-10-05 05:45:48 -0400
committerworldofpeace <worldofpeace@protonmail.ch>2019-10-06 10:23:21 -0400
commit67ac11e0727f76a870ed8bd06e08e26af02c2ee1 (patch)
tree541943fc461f056145cde38bac3a0d1d69f30976 /nixos
parent7e7a155a9cea3422444cd74f26a16b35bc2c3224 (diff)
downloadnixlib-67ac11e0727f76a870ed8bd06e08e26af02c2ee1.tar
nixlib-67ac11e0727f76a870ed8bd06e08e26af02c2ee1.tar.gz
nixlib-67ac11e0727f76a870ed8bd06e08e26af02c2ee1.tar.bz2
nixlib-67ac11e0727f76a870ed8bd06e08e26af02c2ee1.tar.lz
nixlib-67ac11e0727f76a870ed8bd06e08e26af02c2ee1.tar.xz
nixlib-67ac11e0727f76a870ed8bd06e08e26af02c2ee1.tar.zst
nixlib-67ac11e0727f76a870ed8bd06e08e26af02c2ee1.zip
nixos/lightdm: improve systemd service
These improvements come from shopping around
at what other downstreams have done with their
systemd units and recent changes like [0] to gdm.

Note there's no requries or after on dbus.socket because
settings BusName will set this up automaticallly and
give it a type of dbus.

[0]: https://gitlab.gnome.org/GNOME/gdm/commit/2d57f45962dca4975424c20312d7e04f6ff5d55e
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/x11/display-managers/lightdm.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nixos/modules/services/x11/display-managers/lightdm.nix b/nixos/modules/services/x11/display-managers/lightdm.nix
index f105cb496e68..aeee48de701d 100644
--- a/nixos/modules/services/x11/display-managers/lightdm.nix
+++ b/nixos/modules/services/x11/display-managers/lightdm.nix
@@ -220,6 +220,42 @@ in
       exec ${lightdm}/sbin/lightdm
     '';
 
+    # Replaces getty and plymouth quit since it quits plymouth on it's own.
+    systemd.services.display-manager.conflicts = [
+      "getty@tty7.service"
+      "plymouth-quit.service"
+     ];
+
+    # Pull in dependencies of services we replace.
+    systemd.services.display-manager.after = [
+      "rc-local.service"
+      "systemd-machined.service"
+      "systemd-user-sessions.service"
+      "getty@tty7.service"
+      "user.slice"
+    ];
+
+    # user.slice needs to be present
+    systemd.services.display-manager.requires = [
+      "user.slice"
+    ];
+
+    # lightdm stops plymouth so when it fails make sure plymouth stops.
+    systemd.services.display-manager.onFailure = [
+      "plymouth-quit.service"
+    ];
+
+    systemd.services.display-manager.serviceConfig = {
+      BusName = "org.freedesktop.DisplayManager";
+      IgnoreSIGPIPE = "no";
+      # This allows lightdm to pass the LUKS password through to PAM.
+      # login keyring is unlocked automatic when autologin is used.
+      KeyringMode = "shared";
+      KillMode = "mixed";
+      StandardError = "inherit";
+      StandardOutput = "syslog";
+    };
+
     environment.etc."lightdm/lightdm.conf".source = lightdmConf;
     environment.etc."lightdm/users.conf".source = usersConf;