{
  config,
  lib,
  pkgs,
  ...
}:
{
  options.nix-config.gnome.enable = lib.mkOption {
    type = lib.types.bool;
    default = false;
    description = "Enable GNOME desktop environment.";
  };
  config = lib.mkIf config.nix-config.gnome.enable {
    services = {
      displayManager.gdm.enable = true;
      desktopManager.gnome.enable = true;

      gnome = {
        core-apps.enable = false;
        core-developer-tools.enable = false;
        games.enable = false;
      };

      # Exclude some packages to keep the installation lean
      environment.gnome.excludePackages = with pkgs; [
        gnome-tour
        gnome-user-docs
      ];
    };
  };
}
