nixos/mate: use upstream session

This commit is contained in:
worldofpeace 2020-02-13 17:32:12 -05:00
parent 1b96f9b68c
commit b9db3f8ca0
2 changed files with 28 additions and 23 deletions

View File

@ -44,35 +44,32 @@ 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}
${pkgs.mate.mate-session-manager}/bin/mate-session ${optionalString cfg.debug "--debug"} &
waitPID=$!
'';
};
# 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";
environment.systemPackages =
pkgs.mate.basePackages ++

View File

@ -33,6 +33,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";