mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
This avoids having the option always "defined". This also avoids luaLoader configuration in extra files by default. Earlier `vim.loader.disable()` was always added to configs produced by `files` option, effectively disabling luaLoader even if it was explicitly enabled in a top-level configuration.
30 lines
743 B
Nix
30 lines
743 B
Nix
{
|
|
lib,
|
|
config,
|
|
helpers,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.luaLoader;
|
|
in
|
|
{
|
|
options.luaLoader.enable = helpers.mkNullOrOption lib.types.bool ''
|
|
Whether to enable/disable the experimental lua loader:
|
|
|
|
If `true`: Enables the experimental Lua module loader:
|
|
- overrides loadfile
|
|
- adds the lua loader using the byte-compilation cache
|
|
- adds the libs loader
|
|
- removes the default Neovim loader
|
|
|
|
If `false`: Disables the experimental Lua module loader:
|
|
- removes the loaders
|
|
- adds the default Neovim loader
|
|
|
|
If `null`: Nothing is configured.
|
|
'';
|
|
|
|
config = helpers.mkIfNonNull' cfg.enable {
|
|
extraConfigLuaPre = if cfg.enable then "vim.loader.enable()" else "vim.loader.disable()";
|
|
};
|
|
}
|