nix-community.nixvim/modules/lua-loader.nix

31 lines
743 B
Nix
Raw Normal View History

{
lib,
config,
helpers,
...
}:
2024-05-05 19:39:35 +02:00
let
cfg = config.luaLoader;
2024-05-05 19:39:35 +02:00
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 {
2024-05-05 19:39:35 +02:00
extraConfigLuaPre = if cfg.enable then "vim.loader.enable()" else "vim.loader.disable()";
};
}