From 769a33bedd909dd9f482d9cbb957e400fd3bac88 Mon Sep 17 00:00:00 2001 From: Christoph Ruegge Date: Mon, 25 Apr 2016 23:37:18 +0200 Subject: [PATCH] xsession: make updating DBus environment optional --- nixos/modules/services/x11/desktop-managers/gnome3.nix | 2 ++ nixos/modules/services/x11/desktop-managers/xfce.nix | 5 ++++- nixos/modules/services/x11/display-managers/default.nix | 2 +- nixos/modules/services/x11/xserver.nix | 9 +++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index b112fc2422a7..16996b9f96c1 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -165,6 +165,8 @@ in { ''; }; + services.xserver.updateDbusEnvironment = true; + environment.variables.GIO_EXTRA_MODULES = [ "${gnome3.dconf}/lib/gio/modules" "${gnome3.glib_networking.out}/lib/gio/modules" "${gnome3.gvfs}/lib/gio/modules" ]; diff --git a/nixos/modules/services/x11/desktop-managers/xfce.nix b/nixos/modules/services/x11/desktop-managers/xfce.nix index 33b6dd32c193..60934ed5f190 100644 --- a/nixos/modules/services/x11/desktop-managers/xfce.nix +++ b/nixos/modules/services/x11/desktop-managers/xfce.nix @@ -42,10 +42,13 @@ in # Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes. export GTK_DATA_PREFIX=${config.system.path} - exec ${pkgs.stdenv.shell} ${pkgs.xfce.xinitrc} + ${pkgs.stdenv.shell} ${pkgs.xfce.xinitrc} & + waitPID=$! ''; }; + services.xserver.updateDbusEnvironment = true; + environment.systemPackages = [ pkgs.gtk # To get GTK+'s themes. pkgs.hicolor_icon_theme diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index ff78964e5530..376f9f4b46b5 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -126,7 +126,7 @@ let (*) echo "$0: Desktop manager '$desktopManager' not found.";; esac - ${optionalString cfg.startDbusSession '' + ${optionalString (cfg.startDbusSession && cfg.updateDbusEnvironment) '' ${pkgs.glib}/bin/gdbus call --session \ --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus \ --method org.freedesktop.DBus.UpdateActivationEnvironment \ diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index dcf9f820f59c..9cb9c8de31d7 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -233,6 +233,15 @@ in ''; }; + updateDbusEnvironment = mkOption { + type = types.bool; + default = false; + description = '' + Whether to update the DBus activation environment after launching the + desktop manager. + ''; + }; + layout = mkOption { type = types.str; default = "us";