nixos/xfce: clean up, use hyphenated attributes
This commit is contained in:
parent
cf536c3e66
commit
f7a9f96725
@ -3,9 +3,7 @@
|
|||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
xcfg = config.services.xserver;
|
cfg = config.services.xserver.desktopManager.xfce;
|
||||||
pcfg = config.hardware.pulseaudio;
|
|
||||||
cfg = xcfg.desktopManager.xfce;
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -52,17 +50,76 @@ in
|
|||||||
description = "Application used by XFCE to lock the screen.";
|
description = "Application used by XFCE to lock the screen.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs.xfce // pkgs; [
|
||||||
|
# Get GTK+ themes and gtk-update-icon-cache
|
||||||
|
gtk2.out
|
||||||
|
|
||||||
config = mkIf (xcfg.enable && cfg.enable) {
|
# Supplies some abstract icons such as:
|
||||||
|
# utilities-terminal, accessories-text-editor
|
||||||
|
gnome3.defaultIconTheme
|
||||||
|
|
||||||
services.xserver.desktopManager.session = singleton
|
hicolor_icon_theme
|
||||||
{ name = "xfce";
|
tango-icon-theme
|
||||||
|
xfce4-icon-theme
|
||||||
|
|
||||||
|
desktop_file_utils
|
||||||
|
shared_mime_info
|
||||||
|
|
||||||
|
# Needed by Xfce's xinitrc script
|
||||||
|
# TODO: replace with command -v
|
||||||
|
which
|
||||||
|
|
||||||
|
exo
|
||||||
|
garcon
|
||||||
|
gtk-xfce-engine
|
||||||
|
gvfs
|
||||||
|
libxfce4ui
|
||||||
|
tumbler
|
||||||
|
xfconf
|
||||||
|
|
||||||
|
mousepad
|
||||||
|
ristretto
|
||||||
|
xfce4-appfinder
|
||||||
|
xfce4-screenshooter
|
||||||
|
xfce4-session
|
||||||
|
xfce4-settings
|
||||||
|
xfce4-terminal
|
||||||
|
|
||||||
|
(thunar.override { thunarPlugins = cfg.thunarPlugins; })
|
||||||
|
thunar-volman # TODO: drop
|
||||||
|
] ++ (if config.hardware.pulseaudio.enable
|
||||||
|
then [ xfce4-mixer-pulse xfce4-volumed-pulse ]
|
||||||
|
else [ xfce4-mixer xfce4-volumed ])
|
||||||
|
# TODO: NetworkManager doesn't belong here
|
||||||
|
++ optionals config.networking.networkmanager.enable [ networkmanagerapplet ]
|
||||||
|
++ optionals config.powerManagement.enable [ xfce4-power-manager ]
|
||||||
|
++ optionals cfg.enableXfwm [ xfwm4 ]
|
||||||
|
++ optionals (!cfg.noDesktop) [
|
||||||
|
xfce4-panel
|
||||||
|
xfce4-notifyd
|
||||||
|
xfdesktop
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.pathsToLink = [
|
||||||
|
"/share/xfce4"
|
||||||
|
"/share/themes"
|
||||||
|
"/share/mime"
|
||||||
|
"/share/desktop-directories"
|
||||||
|
"/share/gtksourceview-2.0"
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.variables = {
|
||||||
|
GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
|
||||||
|
GIO_EXTRA_MODULES = [ "${pkgs.xfce.gvfs}/lib/gio/modules" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.xserver.desktopManager.session = [{
|
||||||
|
name = "xfce";
|
||||||
bgSupport = true;
|
bgSupport = true;
|
||||||
start =
|
start = ''
|
||||||
''
|
|
||||||
${cfg.extraSessionCommands}
|
${cfg.extraSessionCommands}
|
||||||
|
|
||||||
# Set GTK_PATH so that GTK+ can find the theme engines.
|
# Set GTK_PATH so that GTK+ can find the theme engines.
|
||||||
@ -74,60 +131,12 @@ in
|
|||||||
${pkgs.stdenv.shell} ${pkgs.xfce.xinitrc} &
|
${pkgs.stdenv.shell} ${pkgs.xfce.xinitrc} &
|
||||||
waitPID=$!
|
waitPID=$!
|
||||||
'';
|
'';
|
||||||
};
|
}];
|
||||||
|
|
||||||
services.xserver.updateDbusEnvironment = true;
|
services.xserver.updateDbusEnvironment = true;
|
||||||
|
|
||||||
environment.systemPackages =
|
|
||||||
[ pkgs.gtk2.out # To get GTK+'s themes and gtk-update-icon-cache
|
|
||||||
pkgs.hicolor_icon_theme
|
|
||||||
pkgs.tango-icon-theme
|
|
||||||
pkgs.shared_mime_info
|
|
||||||
pkgs.which # Needed by the xfce's xinitrc script.
|
|
||||||
pkgs."${cfg.screenLock}"
|
|
||||||
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
|
|
||||||
(if pcfg.enable then pkgs.xfce.xfce4mixer_pulse else pkgs.xfce.xfce4mixer)
|
|
||||||
(if pcfg.enable then pkgs.xfce.xfce4volumed_pulse else pkgs.xfce.xfce4volumed)
|
|
||||||
pkgs.xfce.xfce4-screenshooter
|
|
||||||
pkgs.xfce.xfconf
|
|
||||||
# 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
|
|
||||||
]
|
|
||||||
++ optional cfg.enableXfwm pkgs.xfce.xfwm4
|
|
||||||
++ optional config.powerManagement.enable pkgs.xfce.xfce4_power_manager
|
|
||||||
++ optional config.networking.networkmanager.enable pkgs.networkmanagerapplet
|
|
||||||
++ optionals (!cfg.noDesktop)
|
|
||||||
[ pkgs.xfce.xfce4panel
|
|
||||||
pkgs.xfce.xfdesktop
|
|
||||||
pkgs.xfce.xfce4notifyd # found via dbus
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.pathsToLink =
|
|
||||||
[ "/share/xfce4" "/share/themes" "/share/mime" "/share/desktop-directories" "/share/gtksourceview-2.0" ];
|
|
||||||
|
|
||||||
environment.variables.GIO_EXTRA_MODULES = [ "${pkgs.xfce.gvfs}/lib/gio/modules" ];
|
|
||||||
environment.variables.GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
|
|
||||||
|
|
||||||
# Enable helpful DBus services.
|
# Enable helpful DBus services.
|
||||||
services.udisks2.enable = true;
|
services.udisks2.enable = true;
|
||||||
services.upower.enable = config.powerManagement.enable;
|
services.upower.enable = config.powerManagement.enable;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user