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; + }; }; }