# modules/features/desktop/xfce.nix — XFCE in Rosé Pine, for VMs without 3D.## OFF unless the generic host sets `desktop = "xfce";` (_settings.nix). The# full desktop — panel, Whisker menu, Thunar, settings manager — on X11, which# runs in every hypervisor including VirtualBox and Hyper-V. The shared look# (greeter, GTK colours, icons, cursor) is x11.nix.## The XFCE side is set through xfconf (home-manager's xfconf.settings), so it# is applied at login and can still be changed in the settings manager; a# rebuild puts these values back.{ self, ... }:
{
flake.nixosModules.desktop-xfce= { pkgs, lib, user, ... }:
letrp= self.lib.rosePine;
# xfce4-terminal and xfconf both want "#rrggbb" strings.palette= lib.concatStringsSep ";" [
rp.overlay rp.love rp.pine rp.gold rp.foam rp.iris rp.rose rp.text
rp.muted rp.love rp.pine rp.gold rp.foam rp.iris rp.rose rp.text
];
# The desktop background is per monitor, and the monitor's name depends# on the hypervisor's display adapter. These cover VMware, VirtualBox,# QEMU/virtio and Hyper-V; on real hardware set it once in Desktop# settings.monitors= [ "monitorVirtual-1""monitorVirtual1""monitorVGA-1""monitorDP-1""monitorHDMI-1""monitor0" ];
backdrop= lib.listToAttrs (lib.concatMap (m: [
{ name="backdrop/screen0/${m}/workspace0/image-style"; value=0; } # none: colour only { name="backdrop/screen0/${m}/workspace0/color-style"; value=0; } # solid { name="backdrop/screen0/${m}/workspace0/rgba1"; value= [ 0.0980.0900.1411.0 ]; } # base #191724 ]) monitors);
in {
imports= [ self.nixosModules.desktop-x11 ];
services.xserver.desktopManager.xfce.enable=true;
services.displayManager.defaultSession="xfce";
environment.systemPackages=with pkgs; [
xfce4-whiskermenu-plugin
xfce4-pulseaudio-plugin
xfce4-clipman-plugin
];
home-manager.users.${user}= {
xfconf.settings= {
xsettings= {
"Net/ThemeName"="adw-gtk3-dark";
"Net/IconThemeName"="rose-pine";
"Gtk/CursorThemeName"="BreezeX-RosePine-Linux";
"Gtk/FontName"="Inter 10";
"Gtk/MonospaceFontName"="JetBrainsMono Nerd Font 10";
};
xfwm4= {
"general/theme"="Default"; # draws its frame from the GTK colours above"general/title_font"="Inter Bold 10";
"general/use_compositing"=false; # cheaper, and VMs rarely accelerate it"general/workspace_count"=4;
};
xfce4-desktop= backdrop // {
"desktop-icons/style"=0; # no icons on the desktop };
xfce4-terminal= {
"color-use-theme"=false;
"color-foreground"= rp.text;
"color-background"= rp.base;
"color-cursor"= rp.rose;
"color-selection"= rp.text;
"color-selection-background"= rp.hlMed;
"color-palette"= palette;
"font-name"="JetBrainsMono Nerd Font 11";
"font-use-system"=false;
"scrolling-unlimited"=true;
};
xfce4-session."general/SaveOnExit"=false; # the declared layout, every login };
};
};
}