1 { config, lib, pkgs, utils, ... }:
7 xcfg = config.services.xserver;
8 cfg = xcfg.desktopManager.mate;
15 services.xserver.desktopManager.mate = {
19 description = "Enable the MATE desktop environment";
22 debug = mkEnableOption "mate-session debug messages";
24 extraPanelApplets = mkOption {
26 example = literalExpression "with pkgs.mate; [ mate-applets ]";
27 type = types.listOf types.package;
28 description = "Extra applets to add to mate-panel.";
31 extraCajaExtensions = mkOption {
33 example = lib.literalExpression "with pkgs.mate; [ caja-extensions ]";
34 type = types.listOf types.package;
35 description = "Extra extensions to add to caja.";
38 enableWaylandSession = mkEnableOption "MATE Wayland session";
41 environment.mate.excludePackages = mkOption {
43 example = literalExpression "[ pkgs.mate.mate-terminal pkgs.mate.pluma ]";
44 type = types.listOf types.package;
45 description = "Which MATE packages to exclude from the default environment";
51 (mkIf (cfg.enable || cfg.enableWaylandSession) {
52 services.displayManager.sessionPackages = [
53 pkgs.mate.mate-session-manager
57 environment.sessionVariables.MATE_SESSION_DEBUG = mkIf cfg.debug "1";
59 environment.systemPackages = utils.removePackagesByName
60 (pkgs.mate.basePackages ++
61 pkgs.mate.extraPackages ++
63 (pkgs.mate.caja-with-extensions.override {
64 extensions = cfg.extraCajaExtensions;
66 (pkgs.mate.mate-panel-with-applets.override {
67 applets = cfg.extraPanelApplets;
69 pkgs.desktop-file-utils
73 pkgs.xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
74 pkgs.yelp # for 'Contents' in 'Help' menus
76 config.environment.mate.excludePackages;
78 programs.dconf.enable = true;
79 # Shell integration for VTE terminals
80 programs.bash.vteIntegration = mkDefault true;
81 programs.zsh.vteIntegration = mkDefault true;
83 # Mate uses this for printing
84 programs.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
86 services.gnome.at-spi2-core.enable = true;
87 services.gnome.glib-networking.enable = true;
88 services.gnome.gnome-keyring.enable = true;
89 services.udev.packages = [ pkgs.mate.mate-settings-daemon ];
90 services.gvfs.enable = true;
91 services.upower.enable = config.powerManagement.enable;
92 services.libinput.enable = mkDefault true;
94 security.pam.services.mate-screensaver.unixAuth = true;
96 xdg.portal.configPackages = mkDefault [ pkgs.mate.mate-desktop ];
98 environment.pathsToLink = [ "/share" ];
100 (mkIf cfg.enableWaylandSession {
101 programs.wayfire.enable = true;
102 programs.wayfire.plugins = [ pkgs.wayfirePlugins.firedecor ];
104 environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${pkgs.mate.mate-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
106 environment.systemPackages = [ pkgs.mate.mate-wayland-session ];
107 services.displayManager.sessionPackages = [ pkgs.mate.mate-wayland-session ];