{ config, pkgs, lib, ... }: let inherit (lib) mkOption mkIf types; cfg = config.deWm; in { options.deWm = { cinnamon.enable = mkOption { default = false; type = types.bool; }; xfce.enable = mkOption { default = false; type = types.bool; }; }; config = { services = { xserver = { desktopManager.cinnamon.enable = cfg.cinnamon.enable; desktopManager.xfce.enable = cfg.xfce.enable; }; }; environment.systemPackages = with pkgs; [ xorg.xev xorg.xinit xtitle xwinmosaic xdo xdotool xsel xclip ] ++ lib.optionals cfg.xfce.enable [ xfce.gigolo xfce.xfce4-dict xfce.xfce4-panel xfce.xfce4-pulseaudio-plugin xfce.xfce4-whiskermenu-plugin xfce.mousepad xfce.xfwm4-themes xfce.xfce4-netload-plugin ]; environment.xfce.excludePackages = with pkgs.xfce; mkIf cfg.xfce.enable [ xfce4-appfinder xfce4-taskmanager xfce4-terminal ]; }; }