add a bunch of language servers

This commit is contained in:
Charlotte 🦝 Delenk 2023-04-13 10:42:27 +01:00
parent 324ce79bd6
commit 2165ad0aa6
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
3 changed files with 96 additions and 0 deletions

View file

@ -0,0 +1,42 @@
{
pkgs,
lib,
config,
...
}:
with builtins;
with lib; let
settingsFormat = pkgs.formats.json {};
in {
config = {
extraLua = let
json_setup = settingsFormat.generate "nix-neovim-lsp-server-setup.json" config.lspconfig;
in
if config.isDesktop
then ''
local from_json = require('nix-neovim.utils').from_json
for k, v in pairs(from_json("${json_setup})) do
require("lspconfig")[k].setup(v)
end
''
else "";
output.path.path =
if config.isDesktop
then config.lspconfigPath
else [];
};
options.lspconfig = mkOption {
type = with types; attrsOf (submodule {freeformType = settingsFormat.type;});
default = {};
description = ''
A set of options to `require("lspconfig").KEY.setup(VALUE)` in lua.
'';
};
options.lspconfigPath = mkOption {
type = with types; listOf package;
default = [];
description = "lspconfig binaries.";
};
}

View file

@ -0,0 +1,46 @@
{pkgs, ...}: {
lspconfigPath = with pkgs; [
nodePackages.bash-language-server
clang
clang-tools
cmake-language-server
dhall-lsp-server
nodePackages.diagnostic-languageserver
nodePackages.dockerfile-language-server-nodejs
elixir-ls
gopls
haskell-language-server
nodePackages.vscode-css-languageserver-bin
nodePackages.vscode-html-languageserver-bin
nodePackages.vscode-json-languageserver
ltex-ls
lua-language-server
marksman
nil
pyright
nodePackages.typescript
nodePackages.typescript-language-server
nodePackages.vim-language-server
];
lspconfig = {
bashls = {};
clangd = {};
cmake = {};
cssls = {};
dhall_lsp_server = {};
diagnosticls = {};
dockerls = {};
elixirls.cmd = "elixir-ls";
gopls = {};
hls.filetypes = ["haskell" "lhaskell" "cabal"];
html = {};
jsonls = {};
ltex = {};
lua_ls = {};
marksman = {};
nil_ls = {};
pyright = {};
tsserver = {};
vimls = {};
};
}

View file

@ -0,0 +1,8 @@
{pkgs, ...}: {
lspconfigPath = with pkgs; [
rust-analyzer
];
lspconfig = {
rust_analyzer = {};
};
}