1 { config, lib, pkgs, utils, ... }:
7 cfg = config.services.xserver.desktopManager.cinnamon;
8 serviceCfg = config.services.cinnamon;
10 nixos-gsettings-overrides = pkgs.cinnamon-gsettings-overrides.override {
11 extraGSettingsOverridePackages = cfg.extraGSettingsOverridePackages;
12 extraGSettingsOverrides = cfg.extraGSettingsOverrides;
15 notExcluded = pkg: (!(lib.elem pkg config.environment.cinnamon.excludePackages));
21 apps.enable = mkEnableOption "Cinnamon default applications";
24 services.xserver.desktopManager.cinnamon = {
25 enable = mkEnableOption "the cinnamon desktop manager";
27 sessionPath = mkOption {
29 type = types.listOf types.package;
30 example = literalExpression "[ pkgs.gpaste ]";
32 Additional list of packages to be added to the session search path.
33 Useful for GSettings-conditional autostart.
35 Note that this should be a last resort; patching the package is preferred (see GPaste).
39 extraGSettingsOverrides = mkOption {
42 description = "Additional gsettings overrides.";
45 extraGSettingsOverridePackages = mkOption {
47 type = types.listOf types.path;
48 description = "List of packages for which gsettings are overridden.";
52 environment.cinnamon.excludePackages = mkOption {
54 example = literalExpression "[ pkgs.blueman ]";
55 type = types.listOf types.package;
56 description = "Which packages cinnamon should exclude from the default environment";
63 services.displayManager.sessionPackages = [ pkgs.cinnamon-common ];
65 services.xserver.displayManager.lightdm.greeters.slick = {
66 enable = mkDefault true;
68 # Taken from mint-artwork.gschema.override
69 theme = mkIf (notExcluded pkgs.mint-themes) {
70 name = mkDefault "Mint-Y-Aqua";
71 package = mkDefault pkgs.mint-themes;
73 iconTheme = mkIf (notExcluded pkgs.mint-y-icons) {
74 name = mkDefault "Mint-Y-Sand";
75 package = mkDefault pkgs.mint-y-icons;
77 cursorTheme = mkIf (notExcluded pkgs.mint-cursor-themes) {
78 name = mkDefault "Bibata-Modern-Classic";
79 package = mkDefault pkgs.mint-cursor-themes;
83 # Have to take care of GDM + Cinnamon on Wayland users
84 environment.extraInit = ''
85 ${concatMapStrings (p: ''
86 if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
87 export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
90 if [ -d "${p}/lib/girepository-1.0" ]; then
91 export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
92 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
98 services.blueman.enable = mkDefault (notExcluded pkgs.blueman);
99 hardware.bluetooth.enable = mkDefault true;
100 security.polkit.enable = true;
101 services.accounts-daemon.enable = true;
102 services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
103 services.dbus.packages = with pkgs; [
109 services.cinnamon.apps.enable = mkDefault true;
110 services.gnome.evolution-data-server.enable = true;
111 services.gnome.glib-networking.enable = true;
112 services.gnome.gnome-keyring.enable = true;
113 services.gvfs.enable = true;
114 services.switcherooControl.enable = mkDefault true; # xapp-gpu-offload-helper
115 services.touchegg.enable = mkDefault true;
116 services.udisks2.enable = true;
117 services.upower.enable = mkDefault config.powerManagement.enable;
118 services.libinput.enable = mkDefault true;
119 services.xserver.updateDbusEnvironment = true;
120 networking.networkmanager.enable = mkDefault true;
122 # Enable colord server
123 services.colord.enable = true;
126 programs.dconf.enable = true;
128 # Enable org.a11y.Bus
129 services.gnome.at-spi2-core.enable = true;
132 security.pam.services = {
133 cinnamon-screensaver = {};
136 environment.systemPackages = with pkgs; ([
144 cinnamon-translations
146 # utils needed by some scripts
149 # session requirements
151 # cinnamon-killer-daemon: provided by cinnamon-common
152 networkmanagerapplet # session requirement - also nm-applet not needed
154 # For a polkit authentication agent
159 gnome-online-accounts-gtk
160 cinnamon-control-center
161 cinnamon-settings-daemon
172 ] ++ utils.removePackagesByName [
177 sound-theme-freedesktop
178 nixos-artwork.wallpapers.simple-dark-gray
186 xapp # provides some xapp-* icons
187 ] config.environment.cinnamon.excludePackages);
189 xdg.mime.enable = true;
190 xdg.icons.enable = true;
192 xdg.portal.enable = true;
193 xdg.portal.extraPortals = [
194 pkgs.xdg-desktop-portal-xapp
195 (pkgs.xdg-desktop-portal-gtk.override {
196 # Do not build portals that we already have.
197 buildPortalsInGnome = false;
201 services.orca.enable = mkDefault (notExcluded pkgs.orca);
203 xdg.portal.configPackages = mkDefault [ pkgs.cinnamon-common ];
205 # Override GSettings schemas
206 environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
208 environment.pathsToLink = [
209 # FIXME: modules should link subdirs of `/share` rather than relying on this
210 "/share" # TODO: https://github.com/NixOS/nixpkgs/issues/47173
213 # Shell integration for VTE terminals
214 programs.bash.vteIntegration = mkDefault true;
215 programs.zsh.vteIntegration = mkDefault true;
217 # Qt application style
219 enable = mkDefault true;
220 style = mkDefault "gtk2";
221 platformTheme = mkDefault "gtk2";
225 fonts.packages = with pkgs; [
226 dejavu_fonts # Default monospace font in LMDE 6+
227 ubuntu-classic # required for default theme
231 (mkIf serviceCfg.apps.enable {
232 programs.gnome-disks.enable = mkDefault (notExcluded pkgs.gnome-disk-utility);
233 programs.gnome-terminal.enable = mkDefault (notExcluded pkgs.gnome-terminal);
234 programs.file-roller.enable = mkDefault (notExcluded pkgs.file-roller);
236 environment.systemPackages = with pkgs; utils.removePackagesByName [
248 # external apps shipped with linux-mint
252 ] config.environment.cinnamon.excludePackages;