nixos/display-managers: always run systemctl of the currently running systemd

Changed files
+5 -5
nixos
modules
services
x11
display-managers
+5 -5
nixos/modules/services/x11/display-managers/default.nix
···
${optionalString cfg.startDbusSession ''
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
-
${config.systemd.package}/bin/systemctl --user start dbus.socket
-
export `${config.systemd.package}/bin/systemctl --user show-environment | grep '^DBUS_SESSION_BUS_ADDRESS'`
fi
''}
···
#
# Also tell systemd about the dbus session bus address.
# This is required by user units using the session bus.
-
${config.systemd.package}/bin/systemctl --user import-environment DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
# Load X defaults. This should probably be safe on wayland too.
${xorg.xrdb}/bin/xrdb -merge ${xresourcesXft}
···
fi
# Start systemd user services for graphical sessions
-
${config.systemd.package}/bin/systemctl --user start graphical-session.target
# Allow the user to setup a custom session type.
if test -x ~/.xsession; then
···
test -n "$waitPID" && wait "$waitPID"
-
${config.systemd.package}/bin/systemctl --user stop graphical-session.target
exit 0
'';
···
${optionalString cfg.startDbusSession ''
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
+
/run/current-system/systemd/bin/systemctl --user start dbus.socket
+
export `/run/current-system/systemd/bin/systemctl --user show-environment | grep '^DBUS_SESSION_BUS_ADDRESS'`
fi
''}
···
#
# Also tell systemd about the dbus session bus address.
# This is required by user units using the session bus.
+
/run/current-system/systemd/bin/systemctl --user import-environment DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
# Load X defaults. This should probably be safe on wayland too.
${xorg.xrdb}/bin/xrdb -merge ${xresourcesXft}
···
fi
# Start systemd user services for graphical sessions
+
/run/current-system/systemd/bin/systemctl --user start graphical-session.target
# Allow the user to setup a custom session type.
if test -x ~/.xsession; then
···
test -n "$waitPID" && wait "$waitPID"
+
/run/current-system/systemd/bin/systemctl --user stop graphical-session.target
exit 0
'';