mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +00:00
theming: works now!!!
This commit is contained in:
parent
c177916790
commit
0fa8fbdf6f
3 changed files with 6 additions and 6 deletions
|
@ -5,7 +5,7 @@ in {
|
|||
vim.theme = {
|
||||
enable = mkDefault false;
|
||||
name = mkDefault "onedark";
|
||||
style = mkDefault "darker";
|
||||
# style = mkDefault "darker";
|
||||
transparent = mkDefault false;
|
||||
extraConfig = mkDefault "";
|
||||
};
|
||||
|
|
|
@ -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}";
|
||||
|
|
|
@ -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}
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue