summary refs log tree commit diff
path: root/nixos/modules/services/x11/display-managers
diff options
context:
space:
mode:
authorChristoph Ruegge <c.ruegge@math.uni-goettingen.de>2016-04-14 11:28:10 +0200
committerChristoph Ruegge <c.ruegge@math.uni-goettingen.de>2016-04-15 21:43:42 +0200
commitf270af1acd52e01f76295def42302bb8535f9c58 (patch)
tree4698fd38bbd5ba094dcaa54d6c1f069a27b2098c /nixos/modules/services/x11/display-managers
parente5d00a28dd77b1a42b6d1d1da3adeb83f7a47638 (diff)
downloadnixlib-f270af1acd52e01f76295def42302bb8535f9c58.tar
nixlib-f270af1acd52e01f76295def42302bb8535f9c58.tar.gz
nixlib-f270af1acd52e01f76295def42302bb8535f9c58.tar.bz2
nixlib-f270af1acd52e01f76295def42302bb8535f9c58.tar.lz
nixlib-f270af1acd52e01f76295def42302bb8535f9c58.tar.xz
nixlib-f270af1acd52e01f76295def42302bb8535f9c58.tar.zst
nixlib-f270af1acd52e01f76295def42302bb8535f9c58.zip
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.
Diffstat (limited to 'nixos/modules/services/x11/display-managers')
-rw-r--r--nixos/modules/services/x11/display-managers/default.nix8
1 files changed, 8 insertions, 0 deletions
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
     '';