nix-community.nixvim/modules/lsp/default.nix
Matt Sturgeon 5308425718
modules/lsp/servers: move to dedicated file/dir
Move the code related to the `lsp.servers` option into a dedicated module,
cleaning up `modules/lsp/default.nix`.
2025-05-05 23:43:30 +01:00

36 lines
646 B
Nix

{ lib, config, ... }:
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";
};
};
imports = [
./servers
./keymaps.nix
];
config = {
lsp.luaConfig.content = lib.mkIf cfg.inlayHints.enable "vim.lsp.inlay_hint.enable(true)";
extraConfigLua = lib.mkIf (cfg.luaConfig.content != "") ''
-- LSP {{{
do
${cfg.luaConfig.content}
end
-- }}}
'';
};
}