neovim-flake/modules/lsp/lspconfig/config.nix

31 lines
675 B
Nix
Raw Normal View History

{
pkgs,
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.lsp;
in {
config = mkIf cfg.lspconfig.enable (mkMerge [
{
vim.lsp.enable = true;
vim.startPlugins = ["nvim-lspconfig"];
vim.luaConfigRC.lspconfig = nvim.dag.entryAfter ["lsp-setup"] ''
local lspconfig = require('lspconfig')
2023-07-23 17:26:38 +02:00
${
# TODO: make border style configurable
optionalString (config.vim.ui.borders.enable) "require('lspconfig.ui.windows').default_options.border = 'single'"
}
'';
}
{
vim.luaConfigRC = mapAttrs (_: v: (nvim.dag.entryAfter ["lspconfig"] v)) cfg.lspconfig.sources;
}
]);
}