From f00440fac5552b92098c020946a2ac45a2fe613b Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Mon, 22 Jun 2015 16:08:29 +0000 Subject: nixos/x11: start session with dbus-launch This is needed by most window managers. Desktop environments usually launch dbus-launch if a session hasn't been started yet so this shouldn't hurt. The worst it can happen is that one dbus session will be unused in case it's started twice. The GDM change is backported from recent gdm. --- nixos/modules/services/x11/display-managers/default.nix | 6 ++++++ nixos/modules/services/x11/xserver.nix | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 736621a14a43..7e05cd84be64 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -50,6 +50,12 @@ let exec > ~/.xsession-errors 2>&1 ''} + ${optionalString cfg.startDbusSession '' + if test -z "$DBUS_SESSION_BUS_ADDRESS"; then + exec ${pkgs.dbus.tools}/bin/dbus-launch --exit-with-session "$0" "$sessionType" + fi + ''} + ${optionalString cfg.displayManager.desktopManagerHandlesLidAndPower '' # Stop systemd from handling the power button and lid switch, # since presumably the desktop environment will handle these. diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 9fddc6a72104..1ec098fded6e 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -238,6 +238,14 @@ in ''; }; + startDbusSession = mkOption { + type = types.bool; + default = true; + description = '' + Whether to start a new DBus session when you log in with dbus-launch. + ''; + }; + layout = mkOption { type = types.str; default = "us"; -- cgit 1.4.1