git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/xfce4-14: init
commitae1cb0bdf98a325062eb9c5bd6af350ca9cf6bf2 authorworldofpeace <worldofpeace@protonmail.ch> dateSun 18 Aug 2019, 20:18 (7 years ago) parent8b56d20
2 files changed+158−1
nixos/modules/services/x11/desktop-managers/default.nix+1−1 nixos/modules/services/x11/desktop-managers/xfce4-14.nix+157
nixos/modules/services/x11/desktop-managers/default.nix+1−1
@@ -18,7 +18,7 @@ in
1818 # determines the default: later modules (if enabled) are preferred.
1919 # E.g., if Plasma 5 is enabled, it supersedes xterm.
2020 imports = [
21− ./none.nix ./xterm.nix ./xfce.nix ./plasma5.nix ./lumina.nix
21+ ./none.nix ./xterm.nix ./xfce.nix ./xfce4-14.nix ./plasma5.nix ./lumina.nix
2222 ./lxqt.nix ./enlightenment.nix ./gnome3.nix ./kodi.nix ./maxx.nix
2323 ./mate.nix ./pantheon.nix ./surf-display.nix
2424 ];
nixos/modules/services/x11/desktop-managers/xfce4-14.nixnew file+157
@@ -0,0 +1,157 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+ cfg = config.services.xserver.desktopManager.xfce4-14;
7+in
8+
9+{
10+ # added 2019-08-18
11+ # needed to preserve some semblance of UI familarity
12+ # with original XFCE module
13+ imports = [
14+ (mkRenamedOptionModule
15+ [ "services" "xserver" "desktopManager" "xfce4-14" "extraSessionCommands" ]
16+ [ "services" "xserver" "displayManager" "sessionCommands" ])
17+ ];
18+
19+ options = {
20+ services.xserver.desktopManager.xfce4-14 = {
21+ enable = mkOption {
22+ type = types.bool;
23+ default = false;
24+ description = "Enable the Xfce desktop environment.";
25+ };
26+
27+ # TODO: support thunar plugins
28+ # thunarPlugins = mkOption {
29+ # default = [];
30+ # type = types.listOf types.package;
31+ # example = literalExample "[ pkgs.xfce4-14.thunar-archive-plugin ]";
32+ # description = ''
33+ # A list of plugin that should be installed with Thunar.
34+ # '';
35+ # };
36+
37+ noDesktop = mkOption {
38+ type = types.bool;
39+ default = false;
40+ description = "Don't install XFCE desktop components (xfdesktop, panel and notification daemon).";
41+ };
42+
43+ enableXfwm = mkOption {
44+ type = types.bool;
45+ default = true;
46+ description = "Enable the XFWM (default) window manager.";
47+ };
48+ };
49+ };
50+
51+ config = mkIf cfg.enable {
52+ environment.systemPackages = with pkgs.xfce4-14 // pkgs; [
53+ glib # for gsettings
54+ gtk3.out # gtk-update-icon-cache
55+
56+ gnome3.adwaita-icon-theme
57+ hicolor-icon-theme
58+ tango-icon-theme
59+ xfce4-icon-theme
60+
61+ desktop-file-utils
62+ shared-mime-info # for update-mime-database
63+
64+ # For a polkit authentication agent
65+ polkit_gnome
66+
67+ # Needed by Xfce's xinitrc script
68+ xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
69+
70+ exo
71+ garcon
72+ gtk-xfce-engine
73+ libxfce4ui
74+ xfconf
75+
76+ mousepad
77+ ristretto
78+ xfce4-appfinder
79+ xfce4-screenshooter
80+ xfce4-session
81+ xfce4-settings
82+ xfce4-terminal
83+
84+ # TODO: resync patch for plugins
85+ #(thunar.override { thunarPlugins = cfg.thunarPlugins; })
86+ thunar
87+ ] # TODO: NetworkManager doesn't belong here
88+ ++ optional config.networking.networkmanager.enable networkmanagerapplet
89+ ++ optional config.hardware.pulseaudio.enable xfce4-pulseaudio-plugin
90+ ++ optional config.powerManagement.enable xfce4-power-manager
91+ ++ optional cfg.enableXfwm xfwm4
92+ ++ optionals (!cfg.noDesktop) [
93+ xfce4-panel
94+ xfce4-notifyd
95+ xfdesktop
96+ ];
97+
98+ environment.pathsToLink = [
99+ "/share/xfce4"
100+ "/lib/xfce4"
101+ "/share/gtksourceview-3.0"
102+ "/share/gtksourceview-4.0"
103+ ];
104+
105+ # Use the correct gnome3 packageSet
106+ networking.networkmanager.basePackages = mkIf config.networking.networkmanager.enable {
107+ inherit (pkgs) networkmanager modemmanager wpa_supplicant crda;
108+ inherit (pkgs.gnome3) networkmanager-openvpn networkmanager-vpnc
109+ networkmanager-openconnect networkmanager-fortisslvpn
110+ networkmanager-iodine networkmanager-l2tp;
111+ };
112+
113+ services.xserver.desktopManager.session = [{
114+ name = "xfce4-14";
115+ bgSupport = true;
116+ start = ''
117+ # Set GTK_PATH so that GTK+ can find the theme engines.
118+ export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
119+
120+ # Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes.
121+ export GTK_DATA_PREFIX=${config.system.path}
122+
123+ ${pkgs.runtimeShell} ${pkgs.xfce4-14.xinitrc} &
124+ waitPID=$!
125+ '';
126+ }];
127+
128+ services.xserver.updateDbusEnvironment = true;
129+ services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
130+
131+ # Enable helpful DBus services.
132+ services.udisks2.enable = true;
133+ security.polkit.enable = true;
134+ services.accounts-daemon.enable = true;
135+ services.upower.enable = config.powerManagement.enable;
136+ services.gnome3.glib-networking.enable = true;
137+ services.gvfs.enable = true;
138+ services.gvfs.package = pkgs.xfce.gvfs;
139+ services.tumbler.enable = true;
140+ services.dbus.packages =
141+ optional config.services.printing.enable pkgs.system-config-printer;
142+ services.xserver.libinput.enable = mkDefault true; # used in xfce4-settings-manager
143+
144+ # Enable default programs
145+ programs.dconf.enable = true;
146+
147+ # Shell integration for VTE terminals
148+ programs.bash.vteIntegration = mkDefault true;
149+ programs.zsh.vteIntegration = mkDefault true;
150+
151+ # Systemd services
152+ systemd.packages = with pkgs.xfce4-14; [
153+ thunar
154+ ] ++ optional (!cfg.noDesktop) xfce4-notifyd;
155+
156+ };
157+}