mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-09 22:55:58 +01:00
lz.n: load lz.n
This commit is contained in:
parent
e839f68a60
commit
434c2e233e
1 changed files with 15 additions and 1 deletions
|
@ -3,12 +3,26 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (builtins) toJSON;
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
cfg = config.vim.lazy;
|
cfg = config.vim.lazy;
|
||||||
|
|
||||||
|
toLznSpec = name: plugin:
|
||||||
|
(removeAttrs plugin ["package"])
|
||||||
|
// {__HACK = mkLuaInline "nil, [1] = ${toJSON name}";};
|
||||||
|
lznSpecs = mapAttrsToList toLznSpec cfg.plugins;
|
||||||
in {
|
in {
|
||||||
config.vim = mkIf cfg.enable {
|
config.vim = mkIf cfg.enable {
|
||||||
startPlugins = ["lz-n"];
|
startPlugins = ["lz-n"];
|
||||||
|
|
||||||
# optPlugins =
|
optPlugins = mapAttrsToList (_: plugin: plugin.package) cfg.plugins;
|
||||||
|
|
||||||
|
luaConfigRC.lzn-load = entryAnywhere ''
|
||||||
|
require('lz.n').load(${toLuaObject lznSpecs})
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue