mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-20 10:51:17 +00:00
treewide: make the entire generated config lua based
This commit is contained in:
parent
b42a98696c
commit
eba3fa831e
17 changed files with 168 additions and 288 deletions
|
|
@ -7,10 +7,10 @@
|
|||
inherit (lib.attrsets) attrNames;
|
||||
inherit (lib.types) bool lines enum;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryBefore;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
cfg = config.vim.theme;
|
||||
supported_themes = import ./supported_themes.nix {
|
||||
supportedThemes = import ./supported-themes.nix {
|
||||
inherit lib config;
|
||||
};
|
||||
in {
|
||||
|
|
@ -21,12 +21,12 @@ in {
|
|||
};
|
||||
|
||||
name = mkOption {
|
||||
type = enum (attrNames supported_themes);
|
||||
description = "Supported themes can be found in `supported_themes.nix`";
|
||||
type = enum (attrNames supportedThemes);
|
||||
description = "Supported themes can be found in `supportedThemes.nix`";
|
||||
};
|
||||
|
||||
style = mkOption {
|
||||
type = enum supported_themes.${cfg.name}.styles;
|
||||
type = enum supportedThemes.${cfg.name}.styles;
|
||||
description = "Specific style for theme if it supports it";
|
||||
};
|
||||
|
||||
|
|
@ -45,11 +45,9 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [cfg.name];
|
||||
configRC.theme = entryBefore ["luaScript"] ''
|
||||
lua << EOF
|
||||
luaConfigRC.theme = entryAfter ["basic"] ''
|
||||
${cfg.extraConfig}
|
||||
${supported_themes.${cfg.name}.setup (with cfg; {inherit style transparent;})}
|
||||
EOF
|
||||
${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent;}}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue