2024-05-05 19:39:35 +02:00
|
|
|
{ lib, config, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
2023-04-15 16:32:10 +02:00
|
|
|
cfg = config.luaLoader;
|
2024-05-05 19:39:35 +02:00
|
|
|
in
|
|
|
|
{
|
2023-04-15 16:32:10 +02:00
|
|
|
options.luaLoader = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
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
|
2024-02-11 12:51:34 +00:00
|
|
|
- removes the default Neovim loader
|
2023-04-15 16:32:10 +02:00
|
|
|
|
|
|
|
If `false`: Disables the experimental Lua module loader:
|
|
|
|
- removes the loaders
|
|
|
|
- adds the default Neovim loader
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
2024-05-05 19:39:35 +02:00
|
|
|
extraConfigLuaPre = if cfg.enable then "vim.loader.enable()" else "vim.loader.disable()";
|
2023-04-15 16:32:10 +02:00
|
|
|
};
|
|
|
|
}
|