nixpkgs/nixos/modules/services/x11/desktop-managers/xfce.nix

111 lines
3.1 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.xfce;
in
{
options = {
2016-04-27 12:11:02 +01: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.
'';
};
2016-04-27 12:11:02 +01:00
noDesktop = mkOption {
type = types.bool;
default = false;
description = "Don't install XFCE desktop components (xfdesktop, panel and notification daemon).";
};
};
2016-04-27 12:11:02 +01:00
};
config = mkIf (xcfg.enable && cfg.enable) {
services.xserver.desktopManager.session = singleton
{ name = "xfce";
bgSupport = true;
start =
''
# Set GTK_PATH so that GTK+ can find the theme engines.
2014-02-06 23:25:50 +00:00
export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
# Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes.
export GTK_DATA_PREFIX=${config.system.path}
${pkgs.stdenv.shell} ${pkgs.xfce.xinitrc} &
waitPID=$!
'';
};
services.xserver.updateDbusEnvironment = true;
environment.systemPackages =
2012-09-21 16:03:07 +01:00
[ pkgs.gtk # To get GTK+'s themes.
pkgs.hicolor_icon_theme
pkgs.tango-icon-theme
pkgs.shared_mime_info
pkgs.which # Needed by the xfce's xinitrc script.
pkgs.xfce.exo
pkgs.xfce.gtk_xfce_engine
pkgs.xfce.mousepad
pkgs.xfce.ristretto
pkgs.xfce.terminal
(pkgs.xfce.thunar.override { thunarPlugins = cfg.thunarPlugins; })
pkgs.xfce.xfce4icontheme
pkgs.xfce.xfce4session
pkgs.xfce.xfce4settings
pkgs.xfce.xfce4mixer
pkgs.xfce.xfce4volumed
2014-01-12 22:31:22 +00:00
pkgs.xfce.xfce4screenshooter
pkgs.xfce.xfconf
pkgs.xfce.xfwm4
# This supplies some "abstract" icons such as
# "utilities-terminal" and "accessories-text-editor".
pkgs.gnome3.defaultIconTheme
pkgs.desktop_file_utils
pkgs.xfce.libxfce4ui
pkgs.xfce.garcon
pkgs.xfce.thunar_volman
pkgs.xfce.gvfs
pkgs.xfce.xfce4_appfinder
pkgs.xfce.tumbler # found via dbus
]
2016-04-27 12:11:02 +01:00
++ optional config.powerManagement.enable pkgs.xfce.xfce4_power_manager
++ optionals (!cfg.noDesktop)
[ pkgs.xfce.xfce4panel
pkgs.xfce.xfdesktop
pkgs.xfce.xfce4notifyd # found via dbus
];
environment.pathsToLink =
2013-08-15 15:37:53 +01:00
[ "/share/xfce4" "/share/themes" "/share/mime" "/share/desktop-directories" "/share/gtksourceview-2.0" ];
environment.variables.GIO_EXTRA_MODULES = [ "${pkgs.xfce.gvfs}/lib/gio/modules" ];
# Enable helpful DBus services.
services.udisks2.enable = true;
2012-09-21 16:03:07 +01:00
services.upower.enable = config.powerManagement.enable;
};
}