{ config, lib, pkgs, ... }: let inherit (lib.options) mkOption mkEnableOption; inherit (lib.types) str package; inherit (lib.modules) mkIf; cfg = config.modules.theming.gtk; in { options.modules.theming.gtk = { enable = mkEnableOption "Wether to enable GTK theming"; theme = { name = mkOption { description = "The GTK theme name"; default = "Gruvbox-Dark-BL"; type = str; }; package = mkOption { description = "The GTK theme package"; default = pkgs.gruvbox-gtk-theme; type = package; }; }; iconTheme = { description = "The GTK icon theme"; name = mkOption { description = "The GTK icon theme name"; default = "Papirus-Dark"; type = str; }; package = mkOption { description = "The GTK icon theme package"; default = pkgs.papirus-icon-theme; type = package; }; }; }; config = mkIf cfg.enable { # NOTE: we need this or gtk breaks programs.dconf.enable = true; environment = { systemPackages = builtins.attrValues { inherit (pkgs) gruvbox-gtk-theme papirus-icon-theme ; }; variables = let cursorSize = 32; in { GTK_THEME = "Gruvbox-Dark"; XCURSOR_THEME = "BreezeX-RosePine-Linux"; XCURSOR_SIZE = cursorSize; HYPRCURSOR_THEME = "BreezeX-RosePine-Linux"; HYPRCURSOR_SIZE = cursorSize; }; }; }; }