1 { lib, pkgs, config, utils, ... }:
4 inherit (lib) concatMapStrings literalExpression mkDefault mkEnableOption mkIf mkOption types;
6 cfg = config.services.xserver.desktopManager.budgie;
8 nixos-background-light = pkgs.nixos-artwork.wallpapers.nineish;
9 nixos-background-dark = pkgs.nixos-artwork.wallpapers.nineish-dark-gray;
11 nixos-gsettings-overrides = pkgs.budgie-gsettings-overrides.override {
12 inherit (cfg) extraGSettingsOverrides extraGSettingsOverridePackages;
13 inherit nixos-background-dark nixos-background-light;
16 nixos-background-info = pkgs.writeTextFile {
17 name = "nixos-background-info";
20 <!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
22 <wallpaper deleted="false">
24 <filename>${nixos-background-light.gnomeFilePath}</filename>
25 <options>zoom</options>
26 <shade_type>solid</shade_type>
27 <pcolor>#d1dcf8</pcolor>
28 <scolor>#e3ebfe</scolor>
30 <wallpaper deleted="false">
31 <name>Nineish Dark Gray</name>
32 <filename>${nixos-background-dark.gnomeFilePath}</filename>
33 <options>zoom</options>
34 <shade_type>solid</shade_type>
35 <pcolor>#151515</pcolor>
36 <scolor>#262626</scolor>
40 destination = "/share/gnome-background-properties/nixos.xml";
43 budgie-control-center' = pkgs.budgie-control-center.override {
44 enableSshSocket = config.services.openssh.startWhenNeeded;
47 notExcluded = pkg: (!(lib.elem pkg config.environment.budgie.excludePackages));
49 meta.maintainers = lib.teams.budgie.members;
52 services.xserver.desktopManager.budgie = {
53 enable = mkEnableOption "the Budgie desktop";
55 sessionPath = mkOption {
57 Additional list of packages to be added to the session search path.
58 Useful for GSettings-conditional autostart.
60 Note that this should be a last resort; patching the package is preferred (see GPaste).
62 type = types.listOf types.package;
64 example = literalExpression "[ pkgs.gpaste ]";
67 extraGSettingsOverrides = mkOption {
68 description = "Additional GSettings overrides.";
73 extraGSettingsOverridePackages = mkOption {
74 description = "List of packages for which GSettings are overridden.";
75 type = types.listOf types.path;
79 extraPlugins = mkOption {
80 description = "Extra plugins for the Budgie desktop";
81 type = types.listOf types.package;
83 example = literalExpression "[ pkgs.budgie-analogue-clock-applet ]";
87 environment.budgie.excludePackages = mkOption {
88 description = "Which packages Budgie should exclude from the default environment.";
89 type = types.listOf types.package;
91 example = literalExpression "[ pkgs.mate-terminal ]";
95 config = mkIf cfg.enable {
96 services.displayManager.sessionPackages = with pkgs; [
100 services.xserver.displayManager.lightdm.greeters.slick = {
101 enable = mkDefault true;
102 theme = mkDefault { name = "Qogir"; package = pkgs.qogir-theme; };
103 iconTheme = mkDefault { name = "Qogir"; package = pkgs.qogir-icon-theme; };
104 cursorTheme = mkDefault { name = "Qogir"; package = pkgs.qogir-icon-theme; };
107 services.xserver.desktopManager.budgie.sessionPath = [ pkgs.budgie-desktop-view ];
109 environment.extraInit = ''
110 ${concatMapStrings (p: ''
111 if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
112 export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
114 if [ -d "${p}/lib/girepository-1.0" ]; then
115 export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
116 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
121 environment.systemPackages = with pkgs;
125 budgie-control-center'
126 (budgie-desktop-with-plugins.override { plugins = cfg.extraPlugins; })
131 # Required by Budgie Menu.
134 # Required by Budgie Control Center.
137 # Provides `gsettings`.
140 # Update user directories.
143 ++ lib.optional config.networking.networkmanager.enable pkgs.networkmanagerapplet
144 ++ (utils.removePackagesByName [
151 mate.mate-system-monitor
157 nixos-background-info
160 nixos-gsettings-overrides
161 ] config.environment.budgie.excludePackages)
164 # Both budgie-desktop-view and nemo defaults to this emulator.
165 programs.gnome-terminal.enable = mkDefault (notExcluded pkgs.gnome-terminal);
172 fonts.fontconfig.defaultFonts = {
173 sansSerif = mkDefault ["Noto Sans"];
174 monospace = mkDefault ["Hack"];
177 # Qt application style.
179 enable = mkDefault true;
180 style = mkDefault "gtk2";
181 platformTheme = mkDefault "gtk2";
184 environment.pathsToLink = [
185 "/share" # TODO: https://github.com/NixOS/nixpkgs/issues/47173
188 # GSettings overrides.
189 environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
191 # Required by Budgie Desktop.
192 services.xserver.updateDbusEnvironment = true;
193 programs.dconf.enable = true;
195 # Required by Budgie Screensaver.
196 security.pam.services.budgie-screensaver = {};
198 # Required by Budgie's Polkit Dialog.
199 security.polkit.enable = mkDefault true;
201 # Required by Budgie Panel plugins and/or Budgie Control Center panels.
202 networking.networkmanager.enable = mkDefault true; # for BCC's Network panel.
203 programs.nm-applet.enable = config.networking.networkmanager.enable; # Budgie has no Network applet.
204 programs.nm-applet.indicator = true; # Budgie uses AppIndicators.
206 hardware.bluetooth.enable = mkDefault true; # for Budgie's Status Indicator and BCC's Bluetooth panel.
208 xdg.portal.enable = mkDefault true; # for BCC's Applications panel.
209 xdg.portal.extraPortals = with pkgs; [
210 xdg-desktop-portal-gtk # provides a XDG Portals implementation.
212 xdg.portal.configPackages = mkDefault [ pkgs.budgie-desktop ];
214 services.geoclue2.enable = mkDefault true; # for BCC's Privacy > Location Services panel.
215 services.upower.enable = config.powerManagement.enable; # for Budgie's Status Indicator and BCC's Power panel.
216 services.libinput.enable = mkDefault true; # for BCC's Mouse panel.
217 services.colord.enable = mkDefault true; # for BCC's Color panel.
218 services.gnome.at-spi2-core.enable = mkDefault true; # for BCC's A11y panel.
219 services.accounts-daemon.enable = mkDefault true; # for BCC's Users panel.
220 services.udisks2.enable = mkDefault true; # for BCC's Details panel.
222 # For BCC's Online Accounts panel.
223 services.gnome.gnome-online-accounts.enable = mkDefault true;
225 # For BCC's Printers panel.
226 services.printing.enable = mkDefault true;
227 services.system-config-printer.enable = config.services.printing.enable;
229 # For BCC's Sharing panel.
230 services.dleyna-renderer.enable = mkDefault true;
231 services.dleyna-server.enable = mkDefault true;
232 services.gnome.gnome-user-share.enable = mkDefault true;
233 services.gnome.rygel.enable = mkDefault true;
235 # Other default services.
236 services.gnome.evolution-data-server.enable = mkDefault true;
237 services.gnome.glib-networking.enable = mkDefault true;
238 services.gnome.gnome-keyring.enable = mkDefault true;
239 services.gnome.gnome-settings-daemon.enable = mkDefault true;
240 services.gvfs.enable = mkDefault true;
242 # Register packages for DBus.
243 services.dbus.packages = [
244 budgie-control-center'
247 # Register packages for udev.
248 services.udev.packages = with pkgs; [
252 # Shell integration for MATE Terminal.
253 programs.bash.vteIntegration = true;
254 programs.zsh.vteIntegration = true;