nixos/gnome3: Add back sessionPath

Implement through `services.xserver.displayManager.sessionCommands`.
This commit is contained in:
Tor Hedin Brønner 2018-07-31 11:01:38 +02:00 committed by Jan Tojnar
parent e8e0edd95c
commit ee34f2537a
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
2 changed files with 26 additions and 1 deletions

View File

@ -21,6 +21,7 @@ with lib;
config = mkIf config.services.gnome3.gpaste.enable { config = mkIf config.services.gnome3.gpaste.enable {
environment.systemPackages = [ pkgs.gnome3.gpaste ]; environment.systemPackages = [ pkgs.gnome3.gpaste ];
services.dbus.packages = [ pkgs.gnome3.gpaste ]; services.dbus.packages = [ pkgs.gnome3.gpaste ];
services.xserver.desktopManager.gnome3.sessionPath = [ pkgs.gnome3.gpaste ];
systemd.packages = [ pkgs.gnome3.gpaste ]; systemd.packages = [ pkgs.gnome3.gpaste ];
}; };
} }

View File

@ -54,6 +54,14 @@ in {
description = "Enable Gnome 3 desktop manager."; description = "Enable Gnome 3 desktop manager.";
}; };
sessionPath = mkOption {
default = [];
example = literalExample "[ pkgs.gnome3.gpaste ]";
description = "Additional list of packages to be added to the session search path.
Useful for gnome shell extensions or gsettings-conditionated autostart.";
apply = list: list ++ [ pkgs.gnome3.gnome-shell pkgs.gnome3.gnome-shell-extensions ];
};
extraGSettingsOverrides = mkOption { extraGSettingsOverrides = mkOption {
default = ""; default = "";
type = types.lines; type = types.lines;
@ -120,6 +128,22 @@ in {
services.xserver.displayManager.extraSessionFilePackages = [ pkgs.gnome3.gnome-session ]; services.xserver.displayManager.extraSessionFilePackages = [ pkgs.gnome3.gnome-session ];
services.xserver.displayManager.sessionCommands = ''
if test "$XDG_CURRENT_DESKTOP" = "GNOME"; then
${concatMapStrings (p: ''
if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
fi
if [ -d "${p}/lib/girepository-1.0" ]; then
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
fi
'') cfg.sessionPath}
fi
'';
# Override default mimeapps # Override default mimeapps
environment.variables.XDG_DATA_DIRS = [ "${mimeAppsList}/share" ]; environment.variables.XDG_DATA_DIRS = [ "${mimeAppsList}/share" ];
@ -133,7 +157,7 @@ in {
environment.variables.GIO_EXTRA_MODULES = [ "${lib.getLib pkgs.gnome3.dconf}/lib/gio/modules" environment.variables.GIO_EXTRA_MODULES = [ "${lib.getLib pkgs.gnome3.dconf}/lib/gio/modules"
"${pkgs.gnome3.glib-networking.out}/lib/gio/modules" "${pkgs.gnome3.glib-networking.out}/lib/gio/modules"
"${pkgs.gnome3.gvfs}/lib/gio/modules" ]; "${pkgs.gnome3.gvfs}/lib/gio/modules" ];
environment.systemPackages = pkgs.gnome3.corePackages environment.systemPackages = pkgs.gnome3.corePackages ++ cfg.sessionPath
++ (removePackagesByName pkgs.gnome3.optionalPackages config.environment.gnome3.excludePackages) ++ [ ++ (removePackagesByName pkgs.gnome3.optionalPackages config.environment.gnome3.excludePackages) ++ [
pkgs.xdg-user-dirs # Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/ pkgs.xdg-user-dirs # Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/
]; ];