2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2010-08-09 00:45:54 +02:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2010-08-09 00:45:54 +02:00
|
|
|
|
|
|
|
let
|
2018-01-08 05:48:10 +01:00
|
|
|
cfg = config.services.xserver.desktopManager.xfce;
|
2010-08-09 00:45:54 +02:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
2016-04-27 13:11:02 +02:00
|
|
|
services.xserver.desktopManager.xfce = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Enable the Xfce desktop environment.";
|
|
|
|
};
|
|
|
|
|
|
|
|
thunarPlugins = mkOption {
|
|
|
|
default = [];
|
|
|
|
type = types.listOf types.package;
|
|
|
|
example = literalExample "[ pkgs.xfce.thunar-archive-plugin ]";
|
|
|
|
description = ''
|
|
|
|
A list of plugin that should be installed with Thunar.
|
|
|
|
'';
|
|
|
|
};
|
2010-08-09 00:45:54 +02:00
|
|
|
|
2016-04-27 13:11:02 +02:00
|
|
|
noDesktop = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Don't install XFCE desktop components (xfdesktop, panel and notification daemon).";
|
|
|
|
};
|
2016-06-20 00:50:14 +02:00
|
|
|
|
|
|
|
extraSessionCommands = mkOption {
|
|
|
|
default = "";
|
|
|
|
type = types.lines;
|
|
|
|
description = ''
|
|
|
|
Shell commands executed just before XFCE is started.
|
|
|
|
'';
|
|
|
|
};
|
2017-02-04 12:53:11 +01:00
|
|
|
|
|
|
|
enableXfwm = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Enable the XFWM (default) window manager.";
|
|
|
|
};
|
2015-10-10 18:16:42 +02:00
|
|
|
};
|
2010-08-09 00:45:54 +02:00
|
|
|
};
|
|
|
|
|
2018-01-08 05:48:10 +01:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = with pkgs.xfce // pkgs; [
|
|
|
|
# Get GTK+ themes and gtk-update-icon-cache
|
|
|
|
gtk2.out
|
|
|
|
|
|
|
|
# Supplies some abstract icons such as:
|
|
|
|
# utilities-terminal, accessories-text-editor
|
|
|
|
gnome3.defaultIconTheme
|
|
|
|
|
2018-02-25 03:23:58 +01:00
|
|
|
hicolor-icon-theme
|
2018-01-08 05:48:10 +01:00
|
|
|
tango-icon-theme
|
|
|
|
xfce4-icon-theme
|
|
|
|
|
|
|
|
# Needed by Xfce's xinitrc script
|
|
|
|
# TODO: replace with command -v
|
|
|
|
which
|
|
|
|
|
|
|
|
exo
|
|
|
|
garcon
|
|
|
|
gtk-xfce-engine
|
|
|
|
gvfs
|
|
|
|
libxfce4ui
|
|
|
|
tumbler
|
|
|
|
xfconf
|
|
|
|
|
|
|
|
mousepad
|
|
|
|
ristretto
|
|
|
|
xfce4-appfinder
|
|
|
|
xfce4-screenshooter
|
|
|
|
xfce4-session
|
|
|
|
xfce4-settings
|
|
|
|
xfce4-terminal
|
|
|
|
|
|
|
|
(thunar.override { thunarPlugins = cfg.thunarPlugins; })
|
|
|
|
thunar-volman # TODO: drop
|
|
|
|
] ++ (if config.hardware.pulseaudio.enable
|
|
|
|
then [ xfce4-mixer-pulse xfce4-volumed-pulse ]
|
2018-07-12 03:41:06 +02:00
|
|
|
else [ xfce4-mixer xfce4-volumed ])
|
2018-01-08 05:48:10 +01:00
|
|
|
# TODO: NetworkManager doesn't belong here
|
|
|
|
++ optionals config.networking.networkmanager.enable [ networkmanagerapplet ]
|
|
|
|
++ optionals config.powerManagement.enable [ xfce4-power-manager ]
|
|
|
|
++ optionals cfg.enableXfwm [ xfwm4 ]
|
|
|
|
++ optionals (!cfg.noDesktop) [
|
|
|
|
xfce4-panel
|
|
|
|
xfce4-notifyd
|
|
|
|
xfdesktop
|
|
|
|
];
|
|
|
|
|
|
|
|
environment.pathsToLink = [
|
|
|
|
"/share/xfce4"
|
|
|
|
"/share/themes"
|
|
|
|
"/share/gtksourceview-2.0"
|
|
|
|
];
|
|
|
|
|
|
|
|
environment.variables = {
|
|
|
|
GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
|
|
|
|
GIO_EXTRA_MODULES = [ "${pkgs.xfce.gvfs}/lib/gio/modules" ];
|
|
|
|
};
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2018-01-08 05:48:10 +01:00
|
|
|
services.xserver.desktopManager.session = [{
|
|
|
|
name = "xfce";
|
|
|
|
bgSupport = true;
|
|
|
|
start = ''
|
|
|
|
${cfg.extraSessionCommands}
|
2016-06-20 00:50:14 +02:00
|
|
|
|
2018-01-08 05:48:10 +01:00
|
|
|
# Set GTK_PATH so that GTK+ can find the theme engines.
|
|
|
|
export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2018-01-08 05:48:10 +01:00
|
|
|
# Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes.
|
|
|
|
export GTK_DATA_PREFIX=${config.system.path}
|
2010-10-11 00:35:18 +02:00
|
|
|
|
2018-03-01 20:38:53 +01:00
|
|
|
${pkgs.runtimeShell} ${pkgs.xfce.xinitrc} &
|
2018-01-08 05:48:10 +01:00
|
|
|
waitPID=$!
|
|
|
|
'';
|
|
|
|
}];
|
2010-08-09 00:45:54 +02:00
|
|
|
|
2016-04-25 23:37:18 +02:00
|
|
|
services.xserver.updateDbusEnvironment = true;
|
|
|
|
|
2011-08-23 01:10:24 +02:00
|
|
|
# Enable helpful DBus services.
|
2013-04-04 09:53:27 +02:00
|
|
|
services.udisks2.enable = true;
|
2012-09-21 17:03:07 +02:00
|
|
|
services.upower.enable = config.powerManagement.enable;
|
2010-08-09 00:45:54 +02:00
|
|
|
};
|
|
|
|
}
|