2024-07-21 09:59:04 +03:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
2023-04-15 16:32:10 +02:00
|
|
|
let
|
|
|
|
cfg = config.luaLoader;
|
2025-04-01 11:56:06 +02:00
|
|
|
inherit (lib.nixvim) mkNullOrOption mkIfNonNull' toLuaObject;
|
2023-04-15 16:32:10 +02:00
|
|
|
in
|
|
|
|
{
|
2025-04-01 11:56:06 +02:00
|
|
|
options.luaLoader.enable = mkNullOrOption lib.types.bool ''
|
2024-07-21 09:59:04 +03:00
|
|
|
Whether to enable/disable the experimental lua loader:
|
2023-04-15 16:32:10 +02:00
|
|
|
|
2024-07-21 09:59:04 +03:00
|
|
|
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
|
2023-04-15 16:32:10 +02:00
|
|
|
|
2024-07-21 09:59:04 +03:00
|
|
|
If `false`: Disables the experimental Lua module loader:
|
|
|
|
- removes the loaders
|
|
|
|
- adds the default Neovim loader
|
|
|
|
|
|
|
|
If `null`: Nothing is configured.
|
|
|
|
'';
|
2023-04-15 16:32:10 +02:00
|
|
|
|
2025-04-01 11:56:06 +02:00
|
|
|
config = mkIfNonNull' cfg.enable {
|
|
|
|
extraConfigLuaPre = "vim.loader.enable(${toLuaObject cfg.enable})";
|
2023-04-15 16:32:10 +02:00
|
|
|
};
|
|
|
|
}
|