Skip to content

Commit 3b50eae

Browse files
committed
plugins/lazy.nvim: add freeform setup option
- Additional settings can now be passed to `require("lazy").setup({})`.
1 parent e80a887 commit 3b50eae

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

plugins/pluginmanagers/lazy.nix

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ in
4141
plugins.lazy = {
4242
enable = mkEnableOption "lazy.nvim";
4343

44+
setup = mkOption { type = types.submodule { freeformType = types.attrsOf types.anything; }; };
45+
4446
plugins =
4547
with types;
4648
let
@@ -203,13 +205,18 @@ in
203205
in
204206
mkIf (cfg.plugins != [ ]) ''
205207
require('lazy').setup(
206-
{
207-
dev = {
208-
path = "${lazyPath}",
209-
patterns = {"."},
210-
fallback = false
211-
},
212-
spec = ${helpers.toLuaObject packedPlugins}
208+
${
209+
helpers.toLuaObject (
210+
{
211+
dev = {
212+
path = "${lazyPath}";
213+
patterns = [ "." ];
214+
fallback = false;
215+
};
216+
spec = packedPlugins;
217+
}
218+
// cfg.setup
219+
)
213220
}
214221
)
215222
'';

tests/test-sources/plugins/pluginmanagers/lazy.nix

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@
99
plugins.lazy = with pkgs.vimPlugins; {
1010
enable = true;
1111

12+
# Setup properties can be directly passed
13+
setup = {
14+
performance = {
15+
rtp = {
16+
# disable some rtp plugins
17+
disabled_plugins = [
18+
"gzip"
19+
"tarPlugin"
20+
"tohtml"
21+
"tutor"
22+
"zipPlugin"
23+
];
24+
};
25+
};
26+
};
27+
1228
plugins = [
1329
vim-closer
1430

0 commit comments

Comments
 (0)