diff --git a/modules/global.nix b/modules/global.nix index 68a0c4d4..ab014816 100644 --- a/modules/global.nix +++ b/modules/global.nix @@ -26,6 +26,18 @@ in description = "Global Catppuccin flavor"; }; + darkFlavor = lib.mkOption { + type = catppuccinLib.types.flavor; + default = config.catppuccin.flavor; + description = "Global Catppuccin dark flavor"; + }; + + lightFlavor = lib.mkOption { + type = catppuccinLib.types.flavor; + default = config.catppuccin.flavor; + description = "Global Catppuccin light flavor"; + }; + accent = lib.mkOption { type = catppuccinLib.types.accent; default = "mauve"; diff --git a/modules/home-manager/zed-editor.nix b/modules/home-manager/zed-editor.nix index a79920b6..66e8368a 100644 --- a/modules/home-manager/zed-editor.nix +++ b/modules/home-manager/zed-editor.nix @@ -6,11 +6,16 @@ let in { - options.catppuccin.zed = catppuccinLib.mkCatppuccinOption { name = "zed"; } // { - italics = lib.mkEnableOption "the italicized version of theme" // { - default = true; + options.catppuccin.zed = + catppuccinLib.mkCatppuccinOption { + name = "zed"; + darkLightSupport = true; + } + // { + italics = lib.mkEnableOption "the italicized version of theme" // { + default = true; + }; }; - }; config = lib.mkIf cfg.enable { programs.zed-editor = { @@ -19,11 +24,11 @@ in userSettings.theme = { light = "Catppuccin " - + catppuccinLib.mkUpper cfg.flavor + + catppuccinLib.mkUpper cfg.lightFlavor + lib.optionalString (!cfg.italics) " - No Italics"; dark = "Catppuccin " - + catppuccinLib.mkUpper cfg.flavor + + catppuccinLib.mkUpper cfg.darkFlavor + lib.optionalString (!cfg.italics) " - No Italics"; }; }; diff --git a/modules/lib/default.nix b/modules/lib/default.nix index 84249be3..10c477f6 100644 --- a/modules/lib/default.nix +++ b/modules/lib/default.nix @@ -189,6 +189,7 @@ lib.makeExtensible (ctp: { default ? if useGlobalEnable then config.catppuccin.enable else false, defaultText ? if useGlobalEnable then "catppuccin.enable" else null, accentSupport ? false, + darkLightSupport ? false, }: { @@ -213,6 +214,19 @@ lib.makeExtensible (ctp: { default = config.catppuccin.accent; description = "Catppuccin accent for ${name}"; }; + } + // optionalAttrs darkLightSupport { + darkFlavor = mkOption { + type = ctp.types.flavor; + default = config.catppuccin.darkFlavor; + description = "Catppuccin dark flavor for ${name}"; + }; + + lightFlavor = mkOption { + type = ctp.types.flavor; + default = config.catppuccin.lightFlavor; + description = "Catppuccin light flavor for ${name}"; + }; }; /**