blob: b6d9595772edbb7d22ba85a72d305059204c412f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
{ config, lib, pkgs, utils, ... }:
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;
};
in
{
options = {
services.cinnamon = {
apps.enable = mkEnableOption "Cinnamon default applications";
};
services.xserver.desktopManager.cinnamon = {
enable = mkEnableOption "the cinnamon desktop manager";
sessionPath = mkOption {
default = [];
type = types.listOf types.package;
example = literalExpression "[ pkgs.gnome.gpaste ]";
description = ''
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;
description = "Additional gsettings overrides.";
};
extraGSettingsOverridePackages = mkOption {
default = [];
type = types.listOf types.path;
description = "List of packages for which gsettings are overridden.";
};
};
environment.cinnamon.excludePackages = mkOption {
default = [];
example = literalExpression "[ pkgs.cinnamon.blueberry ]";
type = types.listOf types.package;
description = "Which packages cinnamon should exclude from the default environment";
};
};
config = mkMerge [
(mkIf (cfg.enable && config.services.xserver.displayManager.lightdm.enable && config.services.xserver.displayManager.lightdm.greeters.gtk.enable) {
services.xserver.displayManager.lightdm.greeters.gtk.extraConfig = mkDefault (builtins.readFile "${pkgs.cinnamon.mint-artwork}/etc/lightdm/lightdm-gtk-greeter.conf.d/99_linuxmint.conf");
})
(mkIf cfg.enable {
services.xserver.displayManager.sessionPackages = [ pkgs.cinnamon.cinnamon-common ];
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
services.blueman.enable = mkDefault true;
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
xapp
];
services.cinnamon.apps.enable = mkDefault true;
services.gnome.glib-networking.enable = true;
services.gnome.gnome-keyring.enable = true;
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
services.gnome.at-spi2-core.enable = true;
# Fix lockscreen
security.pam.services = {
cinnamon-screensaver = {};
};
environment.systemPackages = with pkgs.cinnamon // pkgs; [
desktop-file-utils
nixos-artwork.wallpapers.simple-dark-gray
onboard
sound-theme-freedesktop
# common-files
cinnamon-common
cinnamon-session
cinnamon-desktop
cinnamon-menus
cinnamon-translations
# utils needed by some scripts
killall
# session requirements
cinnamon-screensaver
# cinnamon-killer-daemon: provided by cinnamon-common
networkmanagerapplet # session requirement - also nm-applet not needed
# For a polkit authentication agent
polkit_gnome
# packages
nemo
cinnamon-control-center
cinnamon-settings-daemon
libgnomekbd
orca
# theme
gnome.adwaita-icon-theme
hicolor-icon-theme
gnome.gnome-themes-extra
gtk3.out
mint-artwork
mint-themes
mint-x-icons
mint-y-icons
vanilla-dmz
# other
glib # for gsettings
shared-mime-info # for update-mime-database
xdg-user-dirs
];
# 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;
# Harmonize Qt5 applications under Pantheon
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;
environment.systemPackages = with pkgs // pkgs.gnome // pkgs.cinnamon; utils.removePackagesByName [
# cinnamon team apps
bulky
warpinator
# cinnamon xapp
xviewer
xreader
xed-editor
xplayer
pix
# external apps shipped with linux-mint
hexchat
gnome-calculator
] config.environment.cinnamon.excludePackages;
})
];
}
|