add a bunch of language servers
This commit is contained in:
parent
324ce79bd6
commit
2165ad0aa6
3 changed files with 96 additions and 0 deletions
42
config/programs/vim/modules/lsp/lsp.nix
Normal file
42
config/programs/vim/modules/lsp/lsp.nix
Normal 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.";
|
||||
};
|
||||
}
|
46
config/programs/vim/modules/lsp/misc.nix
Normal file
46
config/programs/vim/modules/lsp/misc.nix
Normal 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 = {};
|
||||
};
|
||||
}
|
8
config/programs/vim/modules/lsp/rust-analyzer.nix
Normal file
8
config/programs/vim/modules/lsp/rust-analyzer.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{pkgs, ...}: {
|
||||
lspconfigPath = with pkgs; [
|
||||
rust-analyzer
|
||||
];
|
||||
lspconfig = {
|
||||
rust_analyzer = {};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue