2023-07-13 09:17:51 -07:00
|
|
|
{ config
|
|
|
|
, pkgs
|
|
|
|
, lib
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (lib) ctp mkOption types;
|
|
|
|
cfg = config.gtk.catppuccin;
|
|
|
|
enable = cfg.enable && config.gtk.enable;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.gtk.catppuccin =
|
2023-11-02 10:55:47 -07:00
|
|
|
ctp.mkCatppuccinOpt "gtk"
|
2023-07-13 09:17:51 -07:00
|
|
|
// {
|
2023-11-02 10:55:47 -07:00
|
|
|
accent = ctp.mkAccentOpt "gtk";
|
2023-04-18 17:01:16 -07:00
|
|
|
size = mkOption {
|
|
|
|
type = types.enum [ "standard" "compact" ];
|
|
|
|
default = "standard";
|
|
|
|
description = "Catppuccin size variant for gtk";
|
|
|
|
};
|
|
|
|
tweaks = mkOption {
|
|
|
|
type = types.listOf (types.enum [ "black" "rimless" "normal" ]);
|
|
|
|
default = [ "normal" ];
|
|
|
|
description = "Catppuccin tweaks for gtk";
|
|
|
|
};
|
2023-11-04 16:46:21 -07:00
|
|
|
|
|
|
|
cursor = ctp.mkCatppuccinOpt "gtk cursors"
|
|
|
|
// {
|
|
|
|
accent = ctp.mkAccentOpt "gtk cursors";
|
|
|
|
};
|
2023-04-14 19:32:44 -07:00
|
|
|
};
|
|
|
|
|
2023-11-04 16:46:21 -07:00
|
|
|
config.gtk = lib.mkIf enable {
|
|
|
|
theme =
|
|
|
|
let
|
|
|
|
flavourUpper = ctp.mkUpper cfg.flavour;
|
|
|
|
accentUpper = ctp.mkUpper cfg.accent;
|
|
|
|
sizeUpper = ctp.mkUpper cfg.size;
|
2023-04-14 19:32:44 -07:00
|
|
|
|
2023-11-04 16:46:21 -07:00
|
|
|
# use the light gtk theme for latte
|
|
|
|
gtkTheme =
|
|
|
|
if cfg.flavour == "latte"
|
|
|
|
then "Light"
|
|
|
|
else "Dark";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
name = "Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}";
|
|
|
|
package = pkgs.catppuccin-gtk.override {
|
|
|
|
inherit (cfg) size tweaks;
|
|
|
|
accents = [ cfg.accent ];
|
|
|
|
variant = cfg.flavour;
|
|
|
|
};
|
2023-04-14 19:32:44 -07:00
|
|
|
};
|
2023-11-04 16:46:21 -07:00
|
|
|
|
|
|
|
cursorTheme =
|
|
|
|
let
|
|
|
|
flavourUpper = ctp.mkUpper cfg.cursor.flavour;
|
|
|
|
accentUpper = ctp.mkUpper cfg.cursor.accent;
|
|
|
|
in
|
|
|
|
lib.mkIf cfg.cursor.enable {
|
2024-04-09 22:53:06 -07:00
|
|
|
name = "Catppuccin-${flavourUpper}-${accentUpper}-Cursors";
|
2023-11-04 16:46:21 -07:00
|
|
|
package = pkgs.catppuccin-cursors.${cfg.cursor.flavour + accentUpper};
|
|
|
|
};
|
|
|
|
};
|
2023-04-14 19:32:44 -07:00
|
|
|
}
|