theming: works now!!!

This commit is contained in:
Charlie Root 2024-10-07 22:24:04 +02:00
parent c177916790
commit 0fa8fbdf6f
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View file

@ -5,7 +5,7 @@ in {
vim.theme = {
enable = mkDefault false;
name = mkDefault "onedark";
style = mkDefault "darker";
# style = mkDefault "darker";
transparent = mkDefault false;
extraConfig = mkDefault "";
};

View file

@ -11,7 +11,6 @@
cfg = config.vim.theme;
mkEnableOption' = name: mkEnableOption name // {default = true;};
numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F"];
base16Options = listToAttrs (map (n: {
name = "base0${n}";

View file

@ -10,12 +10,16 @@
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryBefore;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.theme;
supportedThemes = import ./supported-themes.nix {
inherit lib config;
};
in {
options.vim.theme = {
themes = supportedThemes;
inherit (supportedThemes.${cfg.name}) setupOpts;
enable = mkOption {
type = bool;
description = "Enable theming";
@ -28,9 +32,6 @@ in {
requires all of the colors in {option}`vim.theme.base16-colors` to be set.
'';
};
setupOpts = cfg.themes.${cfg.name}.setupOpts;
themes = supportedThemes;
style = mkOption {
type = enum supportedThemes.${cfg.name}.styles;
default = elemAt supportedThemes.${cfg.name}.styles 0;
@ -59,7 +60,7 @@ in {
luaConfigRC.theme = entryBefore ["pluginConfigs"] ''
${cfg.extraConfig}
require('${name'}').setup(${toLuaObject cfg.themes.${cfg.name}.setupOpts})
require('${name'}').setup(${toLuaObject cfg.setupOpts})
${supportedThemes.${cfg.name}.setup}
'';