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:
parent
f6d91b87e3
commit
5aae2b9fcd
1 changed files with 28 additions and 29 deletions
|
|
@ -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 = {
|
||||||
{
|
path = lazyPath;
|
||||||
dev = {
|
patterns = [ "." ];
|
||||||
path = "${lazyPath}",
|
fallback = false;
|
||||||
patterns = {"."},
|
};
|
||||||
fallback = false
|
spec = packedPlugins;
|
||||||
},
|
};
|
||||||
spec = ${lib.nixvim.toLuaObject packedPlugins},
|
|
||||||
performance = ${lib.nixvim.toLuaObject cfg.performance},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue