From 32a6fa1ad3df0c323fa3c05600ddd2d00a1acb0b Mon Sep 17 00:00:00 2001 From: winston Date: Sat, 2 Dec 2023 23:51:36 +0100 Subject: [PATCH] fix(nix): accent color wasn't applying correctly --- README.md | 2 +- nix/default.nix | 6 ++++-- src/hooks/generateThemes.ts | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3ec67652..350f5a47 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ This means that you will have to either: programs.vscode.extensions = [ # all the theme options will be available as overrides, these are defaults: (pkgs.catppuccin-vsc.override { - accentColor = "mauve"; + accent = "mauve"; boldKeywords = true; italicComments = true; italicKeywords = true; diff --git a/nix/default.nix b/nix/default.nix index 9e84de82..74aaa9c6 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,6 +1,7 @@ { pkgs ? import {}, - accentColor ? "mauve", + accentColor ? null, + accent ? "mauve", boldKeywords ? true, italicComments ? true, italicKeywords ? true, @@ -76,7 +77,8 @@ ''; }; in - (lib.checkListOfEnum "${pname}: accent" validAccents [accentColor]) + (lib.throwIfNot (accentColor == null) "${pname}: deprecated option 'accentColor' is no longer supported, please use 'accent' instead.") + (lib.checkListOfEnum "${pname}: accent" validAccents [accent]) (lib.checkListOfEnum "${pname}: workbenchMode" validWorkbenchModes [workbenchMode]) (lib.checkListOfEnum "${pname}: bracketMode" validBracketModes [bracketMode]) pkgs.vscode-utils.buildVscodeMarketplaceExtension { diff --git a/src/hooks/generateThemes.ts b/src/hooks/generateThemes.ts index d62e937f..0da543d0 100644 --- a/src/hooks/generateThemes.ts +++ b/src/hooks/generateThemes.ts @@ -15,13 +15,14 @@ const flavors = Object.keys(variants) as CatppuccinFlavor[]; // options can also be passed as a JSON string as an environment variable const optEnvVar = process.env.CATPPUCCIN_OPTIONS; -const options = optEnvVar ? JSON.parse(optEnvVar) : {}; +const optEnv = optEnvVar ? JSON.parse(optEnvVar) : {}; const main = async () => { await mkdir(join(repoRoot, "themes"), { recursive: true }); flavors.map((flavor) => { - const theme = compileTheme(flavor, { ...defaultOptions, ...options }); + const options = { ...defaultOptions, ...optEnv }; + const theme = compileTheme(flavor, options); writeFile( join(repoRoot, `themes/${flavor}.json`), JSON.stringify(theme, null, 2),