2010-08-08 23:45:54 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
xcfg = config.services.xserver;
|
|
|
|
cfg = xcfg.desktopManager.xfce;
|
|
|
|
|
2011-08-22 23:52:13 +01:00
|
|
|
isXfce48 = pkgs.xfce ? libxfce4ui;
|
|
|
|
|
2010-08-08 23:45:54 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.xserver.desktopManager.xfce.enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "Enable the Xfce desktop environment.";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-08-08 23:45:54 +01:00
|
|
|
config = mkIf (xcfg.enable && cfg.enable) {
|
|
|
|
|
|
|
|
services.xserver.desktopManager.session = singleton
|
|
|
|
{ name = "xfce";
|
|
|
|
bgSupport = true;
|
|
|
|
start =
|
|
|
|
''
|
2010-08-09 22:59:34 +01:00
|
|
|
# Set GTK_PATH so that GTK+ can find the Xfce theme engine.
|
|
|
|
export GTK_PATH=${pkgs.xfce.gtk_xfce_engine}/lib/gtk-2.0
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-08-09 22:59:34 +01:00
|
|
|
# Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes.
|
|
|
|
export GTK_DATA_PREFIX=${config.system.path}
|
2010-10-10 23:35:18 +01:00
|
|
|
|
|
|
|
# Necessary to get xfce4-mixer to find GST's ALSA plugin.
|
|
|
|
# Ugly.
|
|
|
|
export GST_PLUGIN_PATH=${config.system.path}/lib
|
|
|
|
|
2010-08-09 12:51:44 +01:00
|
|
|
exec ${pkgs.stdenv.shell} ${pkgs.xfce.xfceutils}/etc/xdg/xfce4/xinitrc
|
2010-08-08 23:45:54 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages =
|
2011-02-23 19:06:59 +00:00
|
|
|
[
|
2010-08-09 22:59:34 +01:00
|
|
|
pkgs.gtkLibs.gtk # To get GTK+'s themes.
|
|
|
|
pkgs.hicolor_icon_theme
|
|
|
|
pkgs.shared_mime_info
|
2010-08-09 12:51:44 +01:00
|
|
|
pkgs.which # Needed by the xfce's xinitrc script.
|
|
|
|
pkgs.xfce.exo
|
2010-08-09 22:59:34 +01:00
|
|
|
pkgs.xfce.gtk_xfce_engine
|
|
|
|
pkgs.xfce.libxfcegui4 # For the icons.
|
|
|
|
pkgs.xfce.mousepad
|
|
|
|
pkgs.xfce.ristretto
|
2010-08-08 23:45:54 +01:00
|
|
|
pkgs.xfce.terminal
|
2010-08-09 22:59:34 +01:00
|
|
|
pkgs.xfce.thunar
|
|
|
|
pkgs.xfce.xfce4icontheme
|
2010-08-09 12:51:44 +01:00
|
|
|
pkgs.xfce.xfce4panel
|
|
|
|
pkgs.xfce.xfce4session
|
2010-08-09 22:59:34 +01:00
|
|
|
pkgs.xfce.xfce4settings
|
2010-10-10 23:35:18 +01:00
|
|
|
pkgs.xfce.xfce4mixer
|
2010-08-09 12:51:44 +01:00
|
|
|
pkgs.xfce.xfceutils
|
|
|
|
pkgs.xfce.xfconf
|
|
|
|
pkgs.xfce.xfdesktop
|
|
|
|
pkgs.xfce.xfwm4
|
2010-08-09 22:59:34 +01:00
|
|
|
# This supplies some "abstract" icons such as
|
|
|
|
# "utilities-terminal" and "accessories-text-editor".
|
|
|
|
pkgs.gnome.gnomeicontheme
|
2010-08-16 08:48:06 +01:00
|
|
|
pkgs.desktop_file_utils
|
2010-08-10 00:15:39 +01:00
|
|
|
]
|
2011-08-22 23:52:13 +01:00
|
|
|
++ optionals isXfce48 [
|
|
|
|
pkgs.xfce.libxfce4ui
|
|
|
|
pkgs.xfce.garcon
|
2011-09-05 21:37:06 +01:00
|
|
|
pkgs.xfce.thunar_volman
|
|
|
|
pkgs.xfce.gvfs
|
2011-08-22 23:52:13 +01:00
|
|
|
]
|
2010-08-10 00:15:39 +01:00
|
|
|
++ optional config.powerManagement.enable pkgs.xfce.xfce4_power_manager;
|
2010-08-08 23:45:54 +01:00
|
|
|
|
2010-08-09 22:59:34 +01:00
|
|
|
environment.pathsToLink =
|
2011-08-22 23:52:13 +01:00
|
|
|
[ "/share/xfce4" "/share/themes" "/share/mime" "/share/desktop-directories" ];
|
2011-09-05 21:37:06 +01:00
|
|
|
|
2011-09-05 21:50:15 +01:00
|
|
|
environment.shellInit = optionalString isXfce48
|
2011-09-05 21:37:06 +01:00
|
|
|
''
|
|
|
|
export GIO_EXTRA_MODULES=${pkgs.xfce.gvfs}/lib/gio/modules
|
|
|
|
'';
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2011-08-23 00:10:24 +01:00
|
|
|
# Enable helpful DBus services.
|
2011-08-22 23:52:13 +01:00
|
|
|
services.hal = mkIf (!isXfce48) { enable = true; };
|
2011-08-23 00:10:24 +01:00
|
|
|
services.udisks = mkIf isXfce48 { enable = true; };
|
|
|
|
services.upower = mkIf (isXfce48 && config.powerManagement.enable) { enable = true; };
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-08-08 23:45:54 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|