2022-04-15 01:41:22 +00:00
|
|
|
{ config, lib, pkgs, utils, ... }:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.xserver.desktopManager.cinnamon;
|
|
|
|
serviceCfg = config.services.cinnamon;
|
|
|
|
|
|
|
|
nixos-gsettings-overrides = pkgs.cinnamon.cinnamon-gsettings-overrides.override {
|
|
|
|
extraGSettingsOverridePackages = cfg.extraGSettingsOverridePackages;
|
|
|
|
extraGSettingsOverrides = cfg.extraGSettingsOverrides;
|
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
notExcluded = pkg: (!(lib.elem pkg config.environment.cinnamon.excludePackages));
|
2020-09-25 04:45:31 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.cinnamon = {
|
2022-09-09 14:08:57 +00:00
|
|
|
apps.enable = mkEnableOption (lib.mdDoc "Cinnamon default applications");
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
services.xserver.desktopManager.cinnamon = {
|
2022-09-09 14:08:57 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "the cinnamon desktop manager");
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
sessionPath = mkOption {
|
|
|
|
default = [];
|
2021-02-05 17:12:51 +00:00
|
|
|
type = types.listOf types.package;
|
2021-10-06 13:57:05 +00:00
|
|
|
example = literalExpression "[ pkgs.gnome.gpaste ]";
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
2020-09-25 04:45:31 +00:00
|
|
|
Additional list of packages to be added to the session search path.
|
|
|
|
Useful for GSettings-conditional autostart.
|
|
|
|
|
|
|
|
Note that this should be a last resort; patching the package is preferred (see GPaste).
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
extraGSettingsOverrides = mkOption {
|
|
|
|
default = "";
|
|
|
|
type = types.lines;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc "Additional gsettings overrides.";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extraGSettingsOverridePackages = mkOption {
|
|
|
|
default = [];
|
|
|
|
type = types.listOf types.path;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc "List of packages for which gsettings are overridden.";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.cinnamon.excludePackages = mkOption {
|
|
|
|
default = [];
|
2021-10-06 13:57:05 +00:00
|
|
|
example = literalExpression "[ pkgs.cinnamon.blueberry ]";
|
2020-09-25 04:45:31 +00:00
|
|
|
type = types.listOf types.package;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc "Which packages cinnamon should exclude from the default environment";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkMerge [
|
|
|
|
(mkIf cfg.enable {
|
|
|
|
services.xserver.displayManager.sessionPackages = [ pkgs.cinnamon.cinnamon-common ];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
services.xserver.displayManager.lightdm.greeters.slick = {
|
|
|
|
enable = mkDefault true;
|
|
|
|
|
|
|
|
# Taken from mint-artwork.gschema.override
|
2022-11-21 17:40:18 +00:00
|
|
|
theme = mkIf (notExcluded pkgs.cinnamon.mint-themes) {
|
2022-12-17 10:02:37 +00:00
|
|
|
name = mkDefault "Mint-Y-Aqua";
|
2022-11-21 17:40:18 +00:00
|
|
|
package = mkDefault pkgs.cinnamon.mint-themes;
|
|
|
|
};
|
|
|
|
iconTheme = mkIf (notExcluded pkgs.cinnamon.mint-x-icons) {
|
2022-12-17 10:02:37 +00:00
|
|
|
name = mkDefault "Mint-Y-Aqua";
|
2022-11-21 17:40:18 +00:00
|
|
|
package = mkDefault pkgs.cinnamon.mint-x-icons;
|
|
|
|
};
|
2022-12-17 10:02:37 +00:00
|
|
|
cursorTheme = mkIf (notExcluded pkgs.cinnamon.mint-cursor-themes) {
|
|
|
|
name = mkDefault "Bibata-Modern-Classic";
|
|
|
|
package = mkDefault pkgs.cinnamon.mint-cursor-themes;
|
|
|
|
};
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
services.xserver.displayManager.sessionCommands = ''
|
|
|
|
if test "$XDG_CURRENT_DESKTOP" = "Cinnamon"; then
|
|
|
|
true
|
|
|
|
${concatMapStrings (p: ''
|
|
|
|
if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
|
|
|
|
export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "${p}/lib/girepository-1.0" ]; then
|
|
|
|
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
|
|
|
|
fi
|
|
|
|
'') cfg.sessionPath}
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Default services
|
2022-08-12 12:06:08 +00:00
|
|
|
services.blueman.enable = mkDefault true;
|
2020-09-25 04:45:31 +00:00
|
|
|
hardware.bluetooth.enable = mkDefault true;
|
|
|
|
hardware.pulseaudio.enable = mkDefault true;
|
|
|
|
security.polkit.enable = true;
|
|
|
|
services.accounts-daemon.enable = true;
|
|
|
|
services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
|
|
|
|
services.dbus.packages = with pkgs.cinnamon; [
|
|
|
|
cinnamon-common
|
|
|
|
cinnamon-screensaver
|
|
|
|
nemo
|
2022-08-12 12:06:08 +00:00
|
|
|
xapp
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
services.cinnamon.apps.enable = mkDefault true;
|
2021-05-20 23:08:51 +00:00
|
|
|
services.gnome.glib-networking.enable = true;
|
|
|
|
services.gnome.gnome-keyring.enable = true;
|
2020-09-25 04:45:31 +00:00
|
|
|
services.gvfs.enable = true;
|
|
|
|
services.udisks2.enable = true;
|
|
|
|
services.upower.enable = mkDefault config.powerManagement.enable;
|
|
|
|
services.xserver.libinput.enable = mkDefault true;
|
|
|
|
services.xserver.updateDbusEnvironment = true;
|
|
|
|
networking.networkmanager.enable = mkDefault true;
|
|
|
|
|
|
|
|
# Enable colord server
|
|
|
|
services.colord.enable = true;
|
|
|
|
|
|
|
|
# Enable dconf
|
|
|
|
programs.dconf.enable = true;
|
|
|
|
|
|
|
|
# Enable org.a11y.Bus
|
2021-05-20 23:08:51 +00:00
|
|
|
services.gnome.at-spi2-core.enable = true;
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
# Fix lockscreen
|
|
|
|
security.pam.services = {
|
|
|
|
cinnamon-screensaver = {};
|
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
environment.systemPackages = with pkgs.cinnamon // pkgs; ([
|
2020-09-25 04:45:31 +00:00
|
|
|
desktop-file-utils
|
|
|
|
|
|
|
|
# common-files
|
|
|
|
cinnamon-common
|
|
|
|
cinnamon-session
|
|
|
|
cinnamon-desktop
|
|
|
|
cinnamon-menus
|
2021-05-28 09:39:13 +00:00
|
|
|
cinnamon-translations
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
# utils needed by some scripts
|
|
|
|
killall
|
|
|
|
|
|
|
|
# session requirements
|
|
|
|
cinnamon-screensaver
|
|
|
|
# cinnamon-killer-daemon: provided by cinnamon-common
|
2022-01-19 23:45:15 +00:00
|
|
|
networkmanagerapplet # session requirement - also nm-applet not needed
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
# For a polkit authentication agent
|
|
|
|
polkit_gnome
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# packages
|
|
|
|
nemo
|
|
|
|
cinnamon-control-center
|
|
|
|
cinnamon-settings-daemon
|
2022-01-19 23:45:15 +00:00
|
|
|
libgnomekbd
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
# theme
|
2021-05-20 23:08:51 +00:00
|
|
|
gnome.adwaita-icon-theme
|
|
|
|
gnome.gnome-themes-extra
|
2020-09-25 04:45:31 +00:00
|
|
|
gtk3.out
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
# other
|
|
|
|
glib # for gsettings
|
|
|
|
xdg-user-dirs
|
|
|
|
] ++ utils.removePackagesByName [
|
|
|
|
# accessibility
|
|
|
|
onboard
|
|
|
|
orca
|
|
|
|
|
|
|
|
# theme
|
|
|
|
sound-theme-freedesktop
|
|
|
|
nixos-artwork.wallpapers.simple-dark-gray
|
2020-09-25 04:45:31 +00:00
|
|
|
mint-artwork
|
2022-12-02 08:20:57 +00:00
|
|
|
mint-cursor-themes
|
2020-09-25 04:45:31 +00:00
|
|
|
mint-themes
|
|
|
|
mint-x-icons
|
|
|
|
mint-y-icons
|
2022-11-21 17:40:18 +00:00
|
|
|
] config.environment.cinnamon.excludePackages);
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
xdg.mime.enable = true;
|
|
|
|
xdg.icons.enable = true;
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
# Override GSettings schemas
|
|
|
|
environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
|
|
|
|
|
|
|
|
environment.pathsToLink = [
|
|
|
|
# FIXME: modules should link subdirs of `/share` rather than relying on this
|
|
|
|
"/share" # TODO: https://github.com/NixOS/nixpkgs/issues/47173
|
|
|
|
];
|
|
|
|
|
|
|
|
# Shell integration for VTE terminals
|
|
|
|
programs.bash.vteIntegration = mkDefault true;
|
|
|
|
programs.zsh.vteIntegration = mkDefault true;
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
# Harmonize Qt5 applications under Cinnamon
|
2020-09-25 04:45:31 +00:00
|
|
|
qt5.enable = true;
|
|
|
|
qt5.platformTheme = "gnome";
|
|
|
|
qt5.style = "adwaita";
|
|
|
|
|
|
|
|
# Default Fonts
|
|
|
|
fonts.fonts = with pkgs; [
|
|
|
|
source-code-pro # Default monospace font in 3.32
|
|
|
|
ubuntu_font_family # required for default theme
|
|
|
|
];
|
|
|
|
})
|
|
|
|
|
|
|
|
(mkIf serviceCfg.apps.enable {
|
|
|
|
programs.geary.enable = mkDefault true;
|
|
|
|
programs.gnome-disks.enable = mkDefault true;
|
|
|
|
programs.gnome-terminal.enable = mkDefault true;
|
|
|
|
programs.evince.enable = mkDefault true;
|
|
|
|
programs.file-roller.enable = mkDefault true;
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
environment.systemPackages = with pkgs // pkgs.gnome // pkgs.cinnamon; utils.removePackagesByName [
|
2020-09-25 04:45:31 +00:00
|
|
|
# cinnamon team apps
|
2021-06-28 23:13:55 +00:00
|
|
|
bulky
|
2020-09-25 04:45:31 +00:00
|
|
|
warpinator
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# cinnamon xapp
|
2021-12-06 16:07:01 +00:00
|
|
|
xviewer
|
|
|
|
xreader
|
2022-08-12 12:06:08 +00:00
|
|
|
xed-editor
|
2021-12-06 16:07:01 +00:00
|
|
|
xplayer
|
|
|
|
pix
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# external apps shipped with linux-mint
|
|
|
|
hexchat
|
|
|
|
gnome-calculator
|
2022-08-21 13:32:41 +00:00
|
|
|
gnome-screenshot
|
2022-04-15 01:41:22 +00:00
|
|
|
] config.environment.cinnamon.excludePackages;
|
2020-09-25 04:45:31 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|