mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
Move the code related to the `lsp.servers` option into a dedicated module, cleaning up `modules/lsp/default.nix`.
36 lines
646 B
Nix
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
|
|
-- }}}
|
|
'';
|
|
};
|
|
}
|