diff --git a/modules/home-manager/gtk.nix b/modules/home-manager/gtk.nix index e06611f..4822f07 100644 --- a/modules/home-manager/gtk.nix +++ b/modules/home-manager/gtk.nix @@ -7,6 +7,8 @@ let inherit (lib) ctp mkOption types; cfg = config.gtk.catppuccin; enable = cfg.enable && config.gtk.enable; + # "dark" and "light" can be used alongside the regular accents + cursorAccentType = ctp.mergeEnums (ctp.types.accentOption) (lib.types.enum [ "dark" "light" ]); in { options.gtk.catppuccin = @@ -26,7 +28,7 @@ in cursor = ctp.mkCatppuccinOpt "gtk cursors" // { - accent = ctp.mkAccentOpt "gtk cursors"; + accent = ctp.mkBasicOpt "accent" cursorAccentType "gtk cursors"; }; }; diff --git a/modules/lib/default.nix b/modules/lib/default.nix index 519ec4a..5735929 100644 --- a/modules/lib/default.nix +++ b/modules/lib/default.nix @@ -119,4 +119,9 @@ in assertion = config.xdg.enable; message = "Option xdg.enable must be enabled to apply Catppuccin theming for ${name}"; }; + + # see https://nlewo.github.io/nixos-manual-sphinx/development/option-types.xml.html + # by default enums cannot be merged, but they keep their passed value in `functor.payload`. + # `functor.binOp` can merge those values + mergeEnums = a: b: lib.types.enum (a.functor.binOp a.functor.payload b.functor.payload); }