snowflake/system/de-twm.nix
2025-06-04 13:02:03 +08:00

53 lines
1.3 KiB
Nix

{ inputs, config, pkgs, lib, ... }:
let
inherit (lib) mkOption mkIf types;
cfg = config.deWm;
in
{
imports = [
../shared/hyprland.nix
];
options.deWm = {
cinnamon.enable = mkOption {
default = true; ## at least one of them has to be enabled
type = types.bool;
};
xfce.enable = mkOption {
default = true;
type = types.bool;
};
hyprland.enable = mkOption {
default = config.shared.hyprland.enable;
type = types.bool;
};
};
config = {
services = {
xserver = {
desktopManager.cinnamon.enable = cfg.cinnamon.enable;
desktopManager.xfce.enable = cfg.xfce.enable;
};
};
programs.hyprland = mkIf cfg.hyprland.enable {
enable = true;
package = inputs.hyprland.packages."${pkgs.system}".hyprland;
xwayland.enable = true;
};
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
];
};
}