2024-10-05 14:23:31 +02:00
|
|
|
{ pkgs, ... }:
|
2024-10-05 16:11:12 +02:00
|
|
|
{ lib, options, ... }:
|
2024-10-05 14:23:31 +02:00
|
|
|
pkgs.lib.optionalAttrs
|
|
|
|
# This fails on darwin
|
|
|
|
# See https://github.com/NixOS/nix/issues/4119
|
|
|
|
(!pkgs.stdenv.isDarwin)
|
|
|
|
{
|
|
|
|
plugins.lsp = {
|
|
|
|
enable = true;
|
|
|
|
|
2024-10-05 16:11:12 +02:00
|
|
|
servers =
|
|
|
|
let
|
|
|
|
disabled =
|
2024-10-05 19:25:01 +02:00
|
|
|
(lib.optionals pkgs.stdenv.isDarwin [
|
2024-10-05 16:11:12 +02:00
|
|
|
"fsautocomplete"
|
|
|
|
])
|
|
|
|
++ (lib.optionals pkgs.stdenv.isAarch64 [
|
|
|
|
# Broken
|
|
|
|
"scheme_langserver"
|
|
|
|
])
|
|
|
|
++ (lib.optionals (pkgs.stdenv.hostPlatform.system == "aarch64-linux") [
|
|
|
|
# Binary package not available for this architecture
|
|
|
|
"starpls"
|
|
|
|
# TODO: 2024-10-05 build failure
|
|
|
|
"fstar"
|
|
|
|
])
|
|
|
|
++ (lib.optionals (pkgs.stdenv.hostPlatform.system == "x86_64-darwin") [
|
|
|
|
# Binary package not available for this architecture
|
|
|
|
"starpls"
|
|
|
|
]);
|
|
|
|
|
|
|
|
renamed = lib.attrNames (import ../plugins/lsp/language-servers/_renamed.nix);
|
|
|
|
in
|
|
|
|
lib.mkMerge [
|
|
|
|
(lib.pipe options.plugins.lsp.servers [
|
|
|
|
(lib.mapAttrs (
|
|
|
|
server: opts:
|
|
|
|
{
|
|
|
|
enable = !(lib.elem server disabled);
|
|
|
|
}
|
|
|
|
// lib.optionalAttrs (opts ? package && !(opts.package ? default)) { package = null; }
|
|
|
|
))
|
|
|
|
(lib.filterAttrs (server: _: !(lib.elem server renamed)))
|
|
|
|
])
|
|
|
|
{
|
|
|
|
rust_analyzer = {
|
|
|
|
installCargo = true;
|
|
|
|
installRustc = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2024-10-05 14:23:31 +02:00
|
|
|
};
|
|
|
|
}
|