33 lines
773 B
Nix
33 lines
773 B
Nix
{ lib
|
|
, plugins
|
|
, nvim-lspconfig
|
|
, nlsp-settings-nvim
|
|
, lspsaga-nvim
|
|
, luasnip
|
|
, nvim-cmp
|
|
, cmp-nvim-lsp
|
|
, cmp-luasnip
|
|
, ...
|
|
}:
|
|
|
|
let
|
|
inherit (builtins) readFile;
|
|
lsp = [ nvim-lspconfig nlsp-settings-nvim lspsaga-nvim ];
|
|
snippets = [ luasnip ];
|
|
completions = [
|
|
nvim-cmp # Autocompletion
|
|
cmp-nvim-lsp # LSP source for nvim-cmp
|
|
cmp-luasnip # Snippets source for nvim-cmp
|
|
];
|
|
|
|
lspConfigServers = lib.toLua (lib.attrByPath [ "lspConfig" "servers" ] [ ] plugins);
|
|
lspSagaSettings = lib.toLua (lib.attrByPath [ "lspSaga" "settings" ] { } plugins);
|
|
in
|
|
{
|
|
luaConfig = (readFile (lib.substituteAll { src = ./lspconfig.lua; inherit lspConfigServers lspSagaSettings; }))
|
|
+ (readFile ./nvim-cmp.lua);
|
|
|
|
plugins = lsp
|
|
++ snippets
|
|
++ completions;
|
|
}
|