From f270af1acd52e01f76295def42302bb8535f9c58 Mon Sep 17 00:00:00 2001 From: Christoph Ruegge Date: Thu, 14 Apr 2016 11:28:10 +0200 Subject: [PATCH] xsession: Update DBus activation environment `dbus-launch` is executed early in the script, before desktop managers had a chance to setup the environment. If DBus activation is used, applications launched by this may therefore lack necessary environment variables. This patch sends the complete environment to DBus after launching the desktop manager. --- nixos/modules/services/x11/display-managers/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index be634fc259a2..ff78964e5530 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -126,6 +126,14 @@ let (*) echo "$0: Desktop manager '$desktopManager' not found.";; esac + ${optionalString cfg.startDbusSession '' + ${pkgs.glib}/bin/gdbus call --session \ + --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus \ + --method org.freedesktop.DBus.UpdateActivationEnvironment \ + "{$(env | ${pkgs.gnused}/bin/sed "s/'/\\\\'/g; s/\([^=]*\)=\(.*\)/'\1':'\2'/" \ + | ${pkgs.coreutils}/bin/paste -sd,)}" + ''} + test -n "$waitPID" && wait "$waitPID" exit 0 '';