1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 19:46:06 +01:00

plugins/lazy: introduce settings free-form option

This commit is contained in:
Gaetan Lepage 2025-10-23 00:01:07 +02:00 committed by Gaétan Lepage
parent f6d91b87e3
commit 5aae2b9fcd

View file

@ -8,30 +8,34 @@ lib.nixvim.plugins.mkNeovimPlugin {
package = "lazy-nvim"; package = "lazy-nvim";
maintainers = [ ]; maintainers = [ ];
hasSettings = false;
callSetup = false;
dependencies = [ dependencies = [
"git" "git"
]; ];
settingsExample = {
ui.border = "rounded";
checker.enabled = true;
};
# TODO: Added 2025-10-23, remove after 26.05
optionsRenamedToSettings =
map
(optName: [
"performance"
"rtp"
optName
])
[
"reset"
"path"
"disabled_plugins"
];
extraOptions = extraOptions =
let let
inherit (lib.nixvim) defaultNullOpts; inherit (lib.nixvim) defaultNullOpts;
in in
{ {
performance.rtp = {
reset = defaultNullOpts.mkBool true ''
reset the runtime path to $VIMRUNTIME and your config directory.
'';
paths = defaultNullOpts.mkListOf lib.types.str [ ] ''
add any custom paths here that you want to includes in the rtp
'';
disabled_plugins = defaultNullOpts.mkListOf lib.types.str [ ] ''
list any plugins you want to disable here
'';
};
plugins = plugins =
let let
inherit (lib) mkOption types; inherit (lib) mkOption types;
@ -140,7 +144,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
}; };
extraConfig = cfg: { extraConfig = cfg: {
plugins.lazy.luaConfig.content = plugins.lazy.settings =
let let
processPlugin = processPlugin =
plugin: plugin:
@ -213,18 +217,13 @@ lib.nixvim.plugins.mkNeovimPlugin {
packedPlugins = if lib.length plugins == 1 then lib.head plugins else plugins; packedPlugins = if lib.length plugins == 1 then lib.head plugins else plugins;
in in
lib.mkIf (cfg.plugins != [ ]) '' lib.mkIf (cfg.plugins != [ ]) {
require('lazy').setup(
{
dev = { dev = {
path = "${lazyPath}", path = lazyPath;
patterns = {"."}, patterns = [ "." ];
fallback = false fallback = false;
}, };
spec = ${lib.nixvim.toLuaObject packedPlugins}, spec = packedPlugins;
performance = ${lib.nixvim.toLuaObject cfg.performance}, };
}
)
'';
}; };
} }