3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #80066 from worldofpeace/mate-upstream

nixos/mate: use upstream session
This commit is contained in:
worldofpeace 2020-03-23 13:37:10 -04:00 committed by GitHub
commit a82c39f178
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 23 deletions

View file

@ -44,35 +44,35 @@ in
config = mkIf cfg.enable {
services.xserver.desktopManager.session = singleton {
name = "mate";
bgSupport = true;
start = ''
export XDG_MENU_PREFIX=mate-
services.xserver.displayManager.sessionPackages = [
pkgs.mate.mate-session-manager
];
# Let caja find extensions
export CAJA_EXTENSION_DIRS=$CAJA_EXTENSION_DIRS''${CAJA_EXTENSION_DIRS:+:}${config.system.path}/lib/caja/extensions-2.0
services.xserver.displayManager.sessionCommands = ''
if test "$XDG_CURRENT_DESKTOP" = "MATE"; then
export XDG_MENU_PREFIX=mate-
# Let caja extensions find gsettings schemas
${concatMapStrings (p: ''
# Let caja find extensions
export CAJA_EXTENSION_DIRS=$CAJA_EXTENSION_DIRS''${CAJA_EXTENSION_DIRS:+:}${config.system.path}/lib/caja/extensions-2.0
# Let caja extensions find gsettings schemas
${concatMapStrings (p: ''
if [ -d "${p}/lib/caja/extensions-2.0" ]; then
${addToXDGDirs p}
${addToXDGDirs p}
fi
'')
config.environment.systemPackages
}
'') config.environment.systemPackages}
# Let mate-panel find applets
export MATE_PANEL_APPLETS_DIR=$MATE_PANEL_APPLETS_DIR''${MATE_PANEL_APPLETS_DIR:+:}${config.system.path}/share/mate-panel/applets
export MATE_PANEL_EXTRA_MODULES=$MATE_PANEL_EXTRA_MODULES''${MATE_PANEL_EXTRA_MODULES:+:}${config.system.path}/lib/mate-panel/applets
# Add mate-control-center paths to some XDG variables because its schemas are needed by mate-settings-daemon, and mate-settings-daemon is a dependency for mate-control-center (that is, they are mutually recursive)
${addToXDGDirs pkgs.mate.mate-control-center}
fi
'';
# Add mate-control-center paths to some XDG variables because its schemas are needed by mate-settings-daemon, and mate-settings-daemon is a dependency for mate-control-center (that is, they are mutually recursive)
${addToXDGDirs pkgs.mate.mate-control-center}
# Let mate-panel find applets
environment.sessionVariables."MATE_PANEL_APPLETS_DIR" = "${config.system.path}/share/mate-panel/applets";
environment.sessionVariables."MATE_PANEL_EXTRA_MODULES" = "${config.system.path}/lib/mate-panel/applets";
${pkgs.mate.mate-session-manager}/bin/mate-session ${optionalString cfg.debug "--debug"} &
waitPID=$!
'';
};
# Debugging
environment.sessionVariables.MATE_SESSION_DEBUG = mkIf cfg.debug "1";
environment.systemPackages =
pkgs.mate.basePackages ++

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pkgconfig, gettext, xtrans, dbus-glib, systemd,
libSM, libXtst, gtk3, epoxy, polkit, hicolor-icon-theme, mate,
wrapGAppsHook
wrapGAppsHook, fetchpatch
}:
stdenv.mkDerivation rec {
@ -12,6 +12,14 @@ stdenv.mkDerivation rec {
sha256 = "01scj5d1xlri9b2id8gm9kfni9nzhdjdf7rag7fvcxwqp7baz3h3";
};
patches = [
# allow turning on debugging from environment variable
(fetchpatch {
url = "https://github.com/mate-desktop/mate-session-manager/commit/3ab6fbfc811d00100d7a2959f8bbb157b536690d.patch";
sha256 = "0yjaklq0mp44clymyhy240kxlw95z3azmravh4f5pfm9dys33sg0";
})
];
nativeBuildInputs = [
pkgconfig
gettext
@ -33,6 +41,14 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
postFixup = ''
substituteInPlace $out/share/xsessions/mate.desktop \
--replace "Exec=mate-session" "Exec=$out/bin/mate-session" \
--replace "TryExec=mate-session" "TryExec=$out/bin/mate-session"
'';
passthru.providedSessions = [ "mate" ];
meta = with stdenv.lib; {
description = "MATE Desktop session manager";
homepage = "https://github.com/mate-desktop/mate-session-manager";