mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-13 16:34:27 +00:00
2e751c0772
the conversion procedure is simple: - find all things that look like options, ie calls to either `mkOption` or `lib.mkOption` that take an attrset. remember the attrset as the option - for all options, find a `description` attribute who's value is not a call to `mdDoc` or `lib.mdDoc` - textually convert the entire value of the attribute to MD with a few simple regexes (the set from mdize-module.sh) - if the change produced a change in the manual output, discard - if the change kept the manual unchanged, add some text to the description to make sure we've actually found an option. if the manual changes this time, keep the converted description this procedure converts 80% of nixos options to markdown. around 2000 options remain to be inspected, but most of those fail the "does not change the manual output check": currently the MD conversion process does not faithfully convert docbook tags like <code> and <package>, so any option using such tags will not be converted at all.
175 lines
5.3 KiB
Nix
175 lines
5.3 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.xserver.desktopManager.xfce;
|
|
|
|
in
|
|
{
|
|
meta = {
|
|
maintainers = teams.xfce.members;
|
|
};
|
|
|
|
imports = [
|
|
# added 2019-08-18
|
|
# needed to preserve some semblance of UI familarity
|
|
# with original XFCE module
|
|
(mkRenamedOptionModule
|
|
[ "services" "xserver" "desktopManager" "xfce4-14" "extraSessionCommands" ]
|
|
[ "services" "xserver" "displayManager" "sessionCommands" ])
|
|
|
|
# added 2019-11-04
|
|
# xfce4-14 module removed and promoted to xfce.
|
|
# Needed for configs that used xfce4-14 module to migrate to this one.
|
|
(mkRenamedOptionModule
|
|
[ "services" "xserver" "desktopManager" "xfce4-14" "enable" ]
|
|
[ "services" "xserver" "desktopManager" "xfce" "enable" ])
|
|
(mkRenamedOptionModule
|
|
[ "services" "xserver" "desktopManager" "xfce4-14" "noDesktop" ]
|
|
[ "services" "xserver" "desktopManager" "xfce" "noDesktop" ])
|
|
(mkRenamedOptionModule
|
|
[ "services" "xserver" "desktopManager" "xfce4-14" "enableXfwm" ]
|
|
[ "services" "xserver" "desktopManager" "xfce" "enableXfwm" ])
|
|
(mkRenamedOptionModule
|
|
[ "services" "xserver" "desktopManager" "xfce" "extraSessionCommands" ]
|
|
[ "services" "xserver" "displayManager" "sessionCommands" ])
|
|
(mkRemovedOptionModule [ "services" "xserver" "desktopManager" "xfce" "screenLock" ] "")
|
|
|
|
# added 2022-06-26
|
|
# thunar has its own module
|
|
(mkRenamedOptionModule
|
|
[ "services" "xserver" "desktopManager" "xfce" "thunarPlugins" ]
|
|
[ "programs" "thunar" "plugins" ])
|
|
];
|
|
|
|
options = {
|
|
services.xserver.desktopManager.xfce = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = lib.mdDoc "Enable the Xfce desktop environment.";
|
|
};
|
|
|
|
noDesktop = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = lib.mdDoc "Don't install XFCE desktop components (xfdesktop and panel).";
|
|
};
|
|
|
|
enableXfwm = mkOption {
|
|
type = types.bool;
|
|
default = true;
|
|
description = lib.mdDoc "Enable the XFWM (default) window manager.";
|
|
};
|
|
|
|
enableScreensaver = mkOption {
|
|
type = types.bool;
|
|
default = true;
|
|
description = lib.mdDoc "Enable the XFCE screensaver.";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = with pkgs.xfce // pkgs; [
|
|
glib # for gsettings
|
|
gtk3.out # gtk-update-icon-cache
|
|
|
|
gnome.gnome-themes-extra
|
|
gnome.adwaita-icon-theme
|
|
hicolor-icon-theme
|
|
tango-icon-theme
|
|
xfce4-icon-theme
|
|
|
|
desktop-file-utils
|
|
shared-mime-info # for update-mime-database
|
|
|
|
# For a polkit authentication agent
|
|
polkit_gnome
|
|
|
|
# Needed by Xfce's xinitrc script
|
|
xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
|
|
|
|
exo
|
|
garcon
|
|
libxfce4ui
|
|
|
|
mousepad
|
|
parole
|
|
ristretto
|
|
xfce4-appfinder
|
|
xfce4-notifyd
|
|
xfce4-screenshooter
|
|
xfce4-session
|
|
xfce4-settings
|
|
xfce4-taskmanager
|
|
xfce4-terminal
|
|
] # TODO: NetworkManager doesn't belong here
|
|
++ optional config.networking.networkmanager.enable networkmanagerapplet
|
|
++ optional config.powerManagement.enable xfce4-power-manager
|
|
++ optionals config.hardware.pulseaudio.enable [
|
|
pavucontrol
|
|
# volume up/down keys support:
|
|
# xfce4-pulseaudio-plugin includes all the functionalities of xfce4-volumed-pulse
|
|
# but can only be used with xfce4-panel, so for no-desktop usage we still include
|
|
# xfce4-volumed-pulse
|
|
(if cfg.noDesktop then xfce4-volumed-pulse else xfce4-pulseaudio-plugin)
|
|
] ++ optionals cfg.enableXfwm [
|
|
xfwm4
|
|
xfwm4-themes
|
|
] ++ optionals (!cfg.noDesktop) [
|
|
xfce4-panel
|
|
xfdesktop
|
|
] ++ optional cfg.enableScreensaver xfce4-screensaver;
|
|
|
|
programs.xfconf.enable = true;
|
|
programs.thunar.enable = true;
|
|
|
|
environment.pathsToLink = [
|
|
"/share/xfce4"
|
|
"/lib/xfce4"
|
|
"/share/gtksourceview-3.0"
|
|
"/share/gtksourceview-4.0"
|
|
];
|
|
|
|
services.xserver.desktopManager.session = [{
|
|
name = "xfce";
|
|
desktopNames = [ "XFCE" ];
|
|
bgSupport = true;
|
|
start = ''
|
|
${pkgs.runtimeShell} ${pkgs.xfce.xfce4-session.xinitrc} &
|
|
waitPID=$!
|
|
'';
|
|
}];
|
|
|
|
services.xserver.updateDbusEnvironment = true;
|
|
services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
|
|
|
|
# Enable helpful DBus services.
|
|
services.udisks2.enable = true;
|
|
security.polkit.enable = true;
|
|
services.accounts-daemon.enable = true;
|
|
services.upower.enable = config.powerManagement.enable;
|
|
services.gnome.glib-networking.enable = true;
|
|
services.gvfs.enable = true;
|
|
services.tumbler.enable = true;
|
|
services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
|
|
services.xserver.libinput.enable = mkDefault true; # used in xfce4-settings-manager
|
|
|
|
# Enable default programs
|
|
programs.dconf.enable = true;
|
|
|
|
# Shell integration for VTE terminals
|
|
programs.bash.vteIntegration = mkDefault true;
|
|
programs.zsh.vteIntegration = mkDefault true;
|
|
|
|
# Systemd services
|
|
systemd.packages = with pkgs.xfce; [
|
|
xfce4-notifyd
|
|
];
|
|
|
|
security.pam.services.xfce4-screensaver.unixAuth = cfg.enableScreensaver;
|
|
};
|
|
}
|