2024-10-10 18:47:28 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
nixvimConfiguration,
|
|
|
|
stdenv,
|
2024-12-31 22:22:44 +01:00
|
|
|
runCommandLocal,
|
2024-10-10 18:47:28 +01:00
|
|
|
name ? "lsp-all-servers",
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
_file = ./lsp-servers.nix;
|
|
|
|
|
|
|
|
renamed = builtins.attrNames (import ../plugins/lsp/language-servers/_renamed.nix);
|
|
|
|
|
|
|
|
enable-lsp-module = {
|
|
|
|
inherit _file;
|
|
|
|
|
2024-10-05 14:23:31 +02:00
|
|
|
plugins.lsp = {
|
|
|
|
enable = true;
|
|
|
|
|
2024-10-13 15:22:01 +02:00
|
|
|
servers = {
|
|
|
|
hls = {
|
|
|
|
installGhc = true;
|
|
|
|
};
|
|
|
|
rust_analyzer = {
|
|
|
|
installCargo = true;
|
|
|
|
installRustc = true;
|
|
|
|
};
|
2024-10-10 18:47:28 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
enable-servers-module =
|
|
|
|
{
|
|
|
|
lib,
|
|
|
|
options,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
2025-04-21 12:12:00 +02:00
|
|
|
inherit (pkgs.stdenv) hostPlatform;
|
|
|
|
|
2024-10-10 18:47:28 +01:00
|
|
|
disabled =
|
2024-11-17 13:49:42 +01:00
|
|
|
[
|
2025-05-07 22:43:05 +02:00
|
|
|
# TODO: 2025-05-07: odin is broken
|
|
|
|
# Fixed in https://github.com/NixOS/nixpkgs/pull/404919
|
|
|
|
"ols"
|
|
|
|
|
2024-11-17 21:51:25 +01:00
|
|
|
# DEPRECATED SERVERS
|
|
|
|
# See https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig.lua
|
|
|
|
"ruff_lsp"
|
|
|
|
"bufls"
|
2024-12-14 15:24:25 -06:00
|
|
|
"typst_lsp"
|
2024-10-10 18:47:28 +01:00
|
|
|
]
|
2025-04-21 12:12:00 +02:00
|
|
|
++ lib.optionals (hostPlatform.isLinux && hostPlatform.isAarch64) [
|
2025-04-20 21:55:52 +02:00
|
|
|
# TODO: 2025-04-20 build failure (swift-corelibs-xctest)
|
|
|
|
"sourcekit"
|
|
|
|
|
2025-04-02 15:09:42 +02:00
|
|
|
# pkgs.vectorcode is not available on this platform
|
|
|
|
"vectorcode_server"
|
|
|
|
|
2024-10-10 18:47:28 +01:00
|
|
|
# TODO: 2024-10-05 build failure
|
|
|
|
"fstar"
|
2025-03-04 15:33:27 +01:00
|
|
|
|
|
|
|
# TODO: 2025-03-04 marked as broken
|
|
|
|
"nickel_ls"
|
2024-10-10 18:47:28 +01:00
|
|
|
];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
inherit _file;
|
2024-10-05 16:11:12 +02:00
|
|
|
|
2024-10-10 18:47:28 +01:00
|
|
|
plugins.lsp.servers = lib.pipe options.plugins.lsp.servers [
|
|
|
|
(lib.mapAttrs (
|
|
|
|
server: opts:
|
2024-10-05 16:11:12 +02:00
|
|
|
{
|
2024-10-10 18:47:28 +01:00
|
|
|
enable = !(lib.elem server disabled);
|
2024-10-05 16:11:12 +02:00
|
|
|
}
|
2025-01-30 22:53:55 +01:00
|
|
|
# Some servers are defined using mkUnpackagedOption whose default will throw
|
|
|
|
// lib.optionalAttrs (opts ? package && !(builtins.tryEval opts.package.default).success) {
|
|
|
|
package = null;
|
|
|
|
}
|
2024-10-10 18:47:28 +01:00
|
|
|
))
|
|
|
|
(lib.filterAttrs (server: _: !(lib.elem server renamed)))
|
|
|
|
];
|
2024-10-05 14:23:31 +02:00
|
|
|
};
|
2024-10-10 18:47:28 +01:00
|
|
|
|
|
|
|
result = nixvimConfiguration.extendModules {
|
|
|
|
modules = [
|
|
|
|
enable-lsp-module
|
|
|
|
enable-servers-module
|
|
|
|
{ test.name = name; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
# This fails on darwin
|
|
|
|
# See https://github.com/NixOS/nix/issues/4119
|
|
|
|
if stdenv.isDarwin then
|
2024-12-31 22:22:44 +01:00
|
|
|
runCommandLocal name { } ''
|
2024-10-10 18:47:28 +01:00
|
|
|
touch $out
|
|
|
|
''
|
|
|
|
else
|
|
|
|
result.config.build.test
|