2025-05-05 22:36:48 +01:00
|
|
|
{ lib, config, ... }:
|
2025-04-07 10:42:07 +02:00
|
|
|
let
|
|
|
|
cfg = config.lsp;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.lsp = {
|
|
|
|
luaConfig = lib.mkOption {
|
|
|
|
type = lib.types.pluginLuaConfig;
|
|
|
|
default = { };
|
|
|
|
description = ''
|
|
|
|
Lua code configuring LSP.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
inlayHints = {
|
|
|
|
enable = lib.mkEnableOption "inlay hints globally";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2025-05-03 21:30:50 +01:00
|
|
|
imports = [
|
2025-05-05 22:36:48 +01:00
|
|
|
./servers
|
2025-05-03 21:30:50 +01:00
|
|
|
./keymaps.nix
|
2025-05-03 23:30:31 +01:00
|
|
|
./on-attach.nix
|
2025-05-03 21:30:50 +01:00
|
|
|
];
|
|
|
|
|
2025-05-05 22:36:48 +01:00
|
|
|
config = {
|
|
|
|
lsp.luaConfig.content = lib.mkIf cfg.inlayHints.enable "vim.lsp.inlay_hint.enable(true)";
|
2025-04-30 17:30:30 +01:00
|
|
|
|
2025-05-05 22:36:48 +01:00
|
|
|
extraConfigLua = lib.mkIf (cfg.luaConfig.content != "") ''
|
|
|
|
-- LSP {{{
|
|
|
|
do
|
|
|
|
${cfg.luaConfig.content}
|
|
|
|
end
|
|
|
|
-- }}}
|
|
|
|
'';
|
|
|
|
};
|
2025-04-07 10:42:07 +02:00
|
|
|
}
|