git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/xfce: clean up, use hyphenated attributes
commitf7a9f96725aaf33744a66b6aa53e151ab66d22dc authorYegor Timoshenko <yegortimoshenko@gmail.com> dateMon 8 Jan 2018, 04:48 (9 years ago) parentcf536c3
1 file changed+77−68
nixos/modules/services/x11/desktop-managers/xfce.nix+77−68
nixos/modules/services/x11/desktop-managers/xfce.nix+77−68
@@ -3,9 +3,7 @@
33with lib;
44
55let
6− xcfg = config.services.xserver;
7− pcfg = config.hardware.pulseaudio;
8− cfg = xcfg.desktopManager.xfce;
6+ cfg = config.services.xserver.desktopManager.xfce;
97in
108
119{
@@ -52,82 +50,93 @@ in
5250 description = "Application used by XFCE to lock the screen.";
5351 };
5452 };
55−
5653 };
5754
55+ config = mkIf cfg.enable {
56+ environment.systemPackages = with pkgs.xfce // pkgs; [
57+ # Get GTK+ themes and gtk-update-icon-cache
58+ gtk2.out
59+
60+ # Supplies some abstract icons such as:
61+ # utilities-terminal, accessories-text-editor
62+ gnome3.defaultIconTheme
63+
64+ hicolor_icon_theme
65+ tango-icon-theme
66+ xfce4-icon-theme
67+
68+ desktop_file_utils
69+ shared_mime_info
70+
71+ # Needed by Xfce's xinitrc script
72+ # TODO: replace with command -v
73+ which
74+
75+ exo
76+ garcon
77+ gtk-xfce-engine
78+ gvfs
79+ libxfce4ui
80+ tumbler
81+ xfconf
82+
83+ mousepad
84+ ristretto
85+ xfce4-appfinder
86+ xfce4-screenshooter
87+ xfce4-session
88+ xfce4-settings
89+ xfce4-terminal
90+
91+ (thunar.override { thunarPlugins = cfg.thunarPlugins; })
92+ thunar-volman # TODO: drop
93+ ] ++ (if config.hardware.pulseaudio.enable
94+ then [ xfce4-mixer-pulse xfce4-volumed-pulse ]
95+ else [ xfce4-mixer xfce4-volumed ])
96+ # TODO: NetworkManager doesn't belong here
97+ ++ optionals config.networking.networkmanager.enable [ networkmanagerapplet ]
98+ ++ optionals config.powerManagement.enable [ xfce4-power-manager ]
99+ ++ optionals cfg.enableXfwm [ xfwm4 ]
100+ ++ optionals (!cfg.noDesktop) [
101+ xfce4-panel
102+ xfce4-notifyd
103+ xfdesktop
104+ ];
105+
106+ environment.pathsToLink = [
107+ "/share/xfce4"
108+ "/share/themes"
109+ "/share/mime"
110+ "/share/desktop-directories"
111+ "/share/gtksourceview-2.0"
112+ ];
113+
114+ environment.variables = {
115+ GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
116+ GIO_EXTRA_MODULES = [ "${pkgs.xfce.gvfs}/lib/gio/modules" ];
117+ };
58118
59− config = mkIf (xcfg.enable && cfg.enable) {
60−
61− services.xserver.desktopManager.session = singleton
62− { name = "xfce";
63− bgSupport = true;
64− start =
65− ''
66− ${cfg.extraSessionCommands}
119+ services.xserver.desktopManager.session = [{
120+ name = "xfce";
121+ bgSupport = true;
122+ start = ''
123+ ${cfg.extraSessionCommands}
67124
68− # Set GTK_PATH so that GTK+ can find the theme engines.
69− export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
125+ # Set GTK_PATH so that GTK+ can find the theme engines.
126+ export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
70127
71− # Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes.
72− export GTK_DATA_PREFIX=${config.system.path}
128+ # Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes.
129+ export GTK_DATA_PREFIX=${config.system.path}
73130
74− ${pkgs.stdenv.shell} ${pkgs.xfce.xinitrc} &
75− waitPID=$!
76− '';
77− };
131+ ${pkgs.stdenv.shell} ${pkgs.xfce.xinitrc} &
132+ waitPID=$!
133+ '';
134+ }];
78135
79136 services.xserver.updateDbusEnvironment = true;
80137
81− environment.systemPackages =
82− [ pkgs.gtk2.out # To get GTK+'s themes and gtk-update-icon-cache
83− pkgs.hicolor_icon_theme
84− pkgs.tango-icon-theme
85− pkgs.shared_mime_info
86− pkgs.which # Needed by the xfce's xinitrc script.
87− pkgs."${cfg.screenLock}"
88− pkgs.xfce.exo
89− pkgs.xfce.gtk_xfce_engine
90− pkgs.xfce.mousepad
91− pkgs.xfce.ristretto
92− pkgs.xfce.terminal
93− (pkgs.xfce.thunar.override { thunarPlugins = cfg.thunarPlugins; })
94− pkgs.xfce.xfce4icontheme
95− pkgs.xfce.xfce4session
96− pkgs.xfce.xfce4settings
97− (if pcfg.enable then pkgs.xfce.xfce4mixer_pulse else pkgs.xfce.xfce4mixer)
98− (if pcfg.enable then pkgs.xfce.xfce4volumed_pulse else pkgs.xfce.xfce4volumed)
99− pkgs.xfce.xfce4-screenshooter
100− pkgs.xfce.xfconf
101− # This supplies some "abstract" icons such as
102− # "utilities-terminal" and "accessories-text-editor".
103− pkgs.gnome3.defaultIconTheme
104− pkgs.desktop_file_utils
105− pkgs.xfce.libxfce4ui
106− pkgs.xfce.garcon
107− pkgs.xfce.thunar_volman
108− pkgs.xfce.gvfs
109− pkgs.xfce.xfce4_appfinder
110− pkgs.xfce.tumbler # found via dbus
111− ]
112− ++ optional cfg.enableXfwm pkgs.xfce.xfwm4
113− ++ optional config.powerManagement.enable pkgs.xfce.xfce4_power_manager
114− ++ optional config.networking.networkmanager.enable pkgs.networkmanagerapplet
115− ++ optionals (!cfg.noDesktop)
116− [ pkgs.xfce.xfce4panel
117− pkgs.xfce.xfdesktop
118− pkgs.xfce.xfce4notifyd # found via dbus
119− ];
120−
121− environment.pathsToLink =
122− [ "/share/xfce4" "/share/themes" "/share/mime" "/share/desktop-directories" "/share/gtksourceview-2.0" ];
123−
124− environment.variables.GIO_EXTRA_MODULES = [ "${pkgs.xfce.gvfs}/lib/gio/modules" ];
125− environment.variables.GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
126−
127138 # Enable helpful DBus services.
128139 services.udisks2.enable = true;
129140 services.upower.enable = config.powerManagement.enable;
130−
131141 };
132−
133142}