{
  lib,
  config,
  ...
}: let
  cfg = config.mods.desktop;
in {
  imports = [
    ./xorg.nix
    ./sound.nix
    ./gaming.nix
  ];

  options.mods.desktop = {
    enable = lib.mkEnableOption "enables graphical desktop environment";
    wayland.enable = lib.mkEnableOption "enables hyprland";
  };

  config = lib.mkIf cfg.enable {
    mods.xorg.enable = true;
    mods.sound.enable = true;
    mods.desktop.wayland.enable = lib.mkDefault false;
    programs.hyprland =
      if cfg.wayland.enable
      then {
        enable = true;
        xwayland.enable = true;
      }
      else {
        enable = false;
      };
  };
}
