2022-04-15 01:41:22 +00:00
|
|
|
{ config, lib, pkgs, utils, ... }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
xcfg = config.services.xserver;
|
|
|
|
cfg = xcfg.desktopManager.mate;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.xserver.desktopManager.mate = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Enable the MATE desktop environment";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
debug = mkEnableOption "mate-session debug messages";
|
|
|
|
|
|
|
|
extraPanelApplets = mkOption {
|
|
|
|
default = [ ];
|
|
|
|
example = literalExpression "with pkgs.mate; [ mate-applets ]";
|
|
|
|
type = types.listOf types.package;
|
|
|
|
description = "Extra applets to add to mate-panel.";
|
|
|
|
};
|
|
|
|
|
|
|
|
extraCajaExtensions = mkOption {
|
|
|
|
default = [ ];
|
|
|
|
example = lib.literalExpression "with pkgs.mate; [ caja-extensions ]";
|
|
|
|
type = types.listOf types.package;
|
|
|
|
description = "Extra extensions to add to caja.";
|
|
|
|
};
|
|
|
|
|
|
|
|
enableWaylandSession = mkEnableOption "MATE Wayland session";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
environment.mate.excludePackages = mkOption {
|
|
|
|
default = [];
|
2021-10-06 13:57:05 +00:00
|
|
|
example = literalExpression "[ pkgs.mate.mate-terminal pkgs.mate.pluma ]";
|
2020-04-24 23:36:52 +00:00
|
|
|
type = types.listOf types.package;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Which MATE packages to exclude from the default environment";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
config = mkMerge [
|
|
|
|
(mkIf (cfg.enable || cfg.enableWaylandSession) {
|
|
|
|
services.displayManager.sessionPackages = [
|
|
|
|
pkgs.mate.mate-session-manager
|
|
|
|
];
|
|
|
|
|
|
|
|
# Debugging
|
|
|
|
environment.sessionVariables.MATE_SESSION_DEBUG = mkIf cfg.debug "1";
|
|
|
|
|
|
|
|
environment.systemPackages = utils.removePackagesByName
|
|
|
|
(pkgs.mate.basePackages ++
|
|
|
|
pkgs.mate.extraPackages ++
|
|
|
|
[
|
|
|
|
(pkgs.mate.caja-with-extensions.override {
|
|
|
|
extensions = cfg.extraCajaExtensions;
|
|
|
|
})
|
|
|
|
(pkgs.mate.mate-panel-with-applets.override {
|
|
|
|
applets = cfg.extraPanelApplets;
|
|
|
|
})
|
|
|
|
pkgs.desktop-file-utils
|
|
|
|
pkgs.glib
|
|
|
|
pkgs.gtk3.out
|
|
|
|
pkgs.shared-mime-info
|
|
|
|
pkgs.xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
|
|
|
|
pkgs.yelp # for 'Contents' in 'Help' menus
|
|
|
|
])
|
|
|
|
config.environment.mate.excludePackages;
|
|
|
|
|
|
|
|
programs.dconf.enable = true;
|
|
|
|
# Shell integration for VTE terminals
|
|
|
|
programs.bash.vteIntegration = mkDefault true;
|
|
|
|
programs.zsh.vteIntegration = mkDefault true;
|
|
|
|
|
|
|
|
# Mate uses this for printing
|
|
|
|
programs.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
|
|
|
|
|
|
|
|
services.gnome.at-spi2-core.enable = true;
|
2024-05-15 15:35:15 +00:00
|
|
|
services.gnome.glib-networking.enable = true;
|
2024-04-21 15:54:59 +00:00
|
|
|
services.gnome.gnome-keyring.enable = true;
|
|
|
|
services.udev.packages = [ pkgs.mate.mate-settings-daemon ];
|
|
|
|
services.gvfs.enable = true;
|
|
|
|
services.upower.enable = config.powerManagement.enable;
|
2024-05-15 15:35:15 +00:00
|
|
|
services.libinput.enable = mkDefault true;
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
security.pam.services.mate-screensaver.unixAuth = true;
|
|
|
|
|
|
|
|
xdg.portal.configPackages = mkDefault [ pkgs.mate.mate-desktop ];
|
|
|
|
|
|
|
|
environment.pathsToLink = [ "/share" ];
|
|
|
|
})
|
|
|
|
(mkIf cfg.enableWaylandSession {
|
|
|
|
programs.wayfire.enable = true;
|
|
|
|
programs.wayfire.plugins = [ pkgs.wayfirePlugins.firedecor ];
|
|
|
|
|
|
|
|
environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${pkgs.mate.mate-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
|
|
|
|
|
|
|
|
environment.systemPackages = [ pkgs.mate.mate-wayland-session ];
|
|
|
|
services.displayManager.sessionPackages = [ pkgs.mate.mate-wayland-session ];
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|