From 01b12730125a94c729b48c2e7ff99543ea976db6 Mon Sep 17 00:00:00 2001 From: Jo Date: Wed, 14 May 2025 08:25:10 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Merge=20palette=20option=20into=20m?= =?UTF-8?q?ain=20Catppuccin=20home=20module=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/home/themes/catppuccin/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/home/themes/catppuccin/default.nix b/modules/home/themes/catppuccin/default.nix index 7e49943..11b0ccf 100644 --- a/modules/home/themes/catppuccin/default.nix +++ b/modules/home/themes/catppuccin/default.nix @@ -1,6 +1,7 @@ { lib, self, + pkgs, config, osConfig, namespace, @@ -9,12 +10,15 @@ inherit (lib) mkEnableOption types mkIf; inherit (self.lib) mkOpt; + palette = (pkgs.lib.importJSON (config.catppuccin.sources.palette + "/palette.json")).${config.catppuccin.flavor}.colors; + cfg = config.${namespace}.themes.catppuccin; in { options.${namespace}.themes.catppuccin = { enable = mkEnableOption "the Catppuccin theme, globally."; accent = mkOpt types.str "blue" "The accent colour to use."; flavor = mkOpt types.str "macchiato" "The flavor to use."; + palette = mkOpt (lib.types.attrsOf lib.types.raw) palette "a reference to the current active Catppuccin palette."; }; config = mkIf cfg.enable { @@ -28,6 +32,8 @@ in { cursors.flavor = cfg.flavor; }; - ${namespace}.themes.catppuccin.gtk.enable = mkIf osConfig.${namespace}.desktop.gnome.enable true; + ${namespace}.themes.catppuccin = { + gtk.enable = mkIf osConfig.${namespace}.desktop.gnome.enable true; + }; }; }