2023-04-14 19:32:44 -07:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
let cfg = config.gtk.catppuccin;
|
|
|
|
in {
|
2023-04-17 09:44:07 -07:00
|
|
|
options.gtk.catppuccin = with lib;
|
|
|
|
ctp.mkCatppuccinOpt "gtk" config // {
|
|
|
|
accent = ctp.mkAccentOpt "gtk" config;
|
2023-04-14 19:32:44 -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-04-17 09:44:07 -07:00
|
|
|
config.gtk.theme = with builtins;
|
|
|
|
with lib;
|
2023-04-14 19:32:44 -07:00
|
|
|
let
|
2023-04-17 09:44:07 -07:00
|
|
|
flavourUpper = ctp.mkUpper cfg.flavour;
|
|
|
|
accentUpper = ctp.mkUpper cfg.accent;
|
|
|
|
sizeUpper = ctp.mkUpper cfg.size;
|
2023-04-14 19:32:44 -07:00
|
|
|
|
|
|
|
# use the light gtk theme for latte
|
|
|
|
gtkTheme = if cfg.flavour == "latte" then "Light" else "Dark";
|
|
|
|
|
|
|
|
in mkIf cfg.enable {
|
|
|
|
name =
|
|
|
|
"Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}";
|
|
|
|
package = pkgs.catppuccin-gtk.override {
|
|
|
|
inherit (cfg) size tweaks;
|
|
|
|
accents = [ cfg.accent ];
|
|
|
|
variant = cfg.flavour;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|