diff --git a/nixos/modules/system/boot/systemd/logind.nix b/nixos/modules/system/boot/systemd/logind.nix index f81baae8813e..bdf4ab4d4873 100644 --- a/nixos/modules/system/boot/systemd/logind.nix +++ b/nixos/modules/system/boot/systemd/logind.nix @@ -64,13 +64,13 @@ environment.etc."systemd/logind.conf".text = utils.systemdUtils.lib.settingsToSections config.services.logind.settings; - # Restarting systemd-logind breaks X11 + # Restarting systemd-logind breaks X11 and other user sessions. + # However, reloading the service seems to do the trick of loading new configuration without breaking anything. # - upstream commit: https://cgit.freedesktop.org/xorg/xserver/commit/?id=dc48bd653c7e101 # - systemd announcement: https://github.com/systemd/systemd/blob/22043e4317ecd2bc7834b48a6d364de76bb26d91/NEWS#L103-L112 # - this might be addressed in the future by xorg #systemd.services.systemd-logind.restartTriggers = [ config.environment.etc."systemd/logind.conf".source ]; - systemd.services.systemd-logind.restartIfChanged = false; - systemd.services.systemd-logind.stopIfChanged = false; + systemd.services.systemd-logind.reloadIfChanged = true; # The user-runtime-dir@ service is managed by systemd-logind we should not touch it or else we break the users' sessions. systemd.services."user-runtime-dir@".stopIfChanged = false;