mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
tests/lsp-servers: de-couple from grouped tests
Follow up to cab6b0c9fe
This commit is contained in:
parent
88302aa17a
commit
af650ba940
3 changed files with 102 additions and 83 deletions
|
@ -50,6 +50,8 @@
|
||||||
generated = pkgs.callPackage ../tests/generated.nix { };
|
generated = pkgs.callPackage ../tests/generated.nix { };
|
||||||
|
|
||||||
package-options = pkgs.callPackage ../tests/package-options.nix { inherit nixvimConfiguration; };
|
package-options = pkgs.callPackage ../tests/package-options.nix { inherit nixvimConfiguration; };
|
||||||
|
|
||||||
|
lsp-all-servers = pkgs.callPackage ../tests/lsp-servers.nix { inherit nixvimConfiguration; };
|
||||||
} // import ../tests { inherit pkgs pkgsUnfree helpers; };
|
} // import ../tests { inherit pkgs pkgsUnfree helpers; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,14 +42,7 @@ let
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
# We attempt to build & execute all configurations
|
# We attempt to build & execute all configurations
|
||||||
(lib.pipe
|
lib.pipe (testFiles ++ [ exampleFiles ]) [
|
||||||
(
|
|
||||||
testFiles
|
|
||||||
++ [
|
|
||||||
exampleFiles
|
|
||||||
]
|
|
||||||
)
|
|
||||||
[
|
|
||||||
(builtins.map (
|
(builtins.map (
|
||||||
{
|
{
|
||||||
name,
|
name,
|
||||||
|
@ -70,9 +63,3 @@ in
|
||||||
))
|
))
|
||||||
builtins.listToAttrs
|
builtins.listToAttrs
|
||||||
]
|
]
|
||||||
)
|
|
||||||
// {
|
|
||||||
all-lsp-servers = moduleToTest ./lsp-servers.nix "all-lsp-servers" (
|
|
||||||
import ./lsp-servers.nix { inherit pkgs; }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,38 +1,59 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
{ lib, options, ... }:
|
|
||||||
pkgs.lib.optionalAttrs
|
|
||||||
# This fails on darwin
|
|
||||||
# See https://github.com/NixOS/nix/issues/4119
|
|
||||||
(!pkgs.stdenv.isDarwin)
|
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
|
nixvimConfiguration,
|
||||||
|
stdenv,
|
||||||
|
runCommandNoCCLocal,
|
||||||
|
name ? "lsp-all-servers",
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
_file = ./lsp-servers.nix;
|
||||||
|
|
||||||
|
renamed = builtins.attrNames (import ../plugins/lsp/language-servers/_renamed.nix);
|
||||||
|
|
||||||
|
enable-lsp-module = {
|
||||||
|
inherit _file;
|
||||||
|
|
||||||
plugins.lsp = {
|
plugins.lsp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
servers =
|
servers.rust_analyzer = {
|
||||||
|
installCargo = true;
|
||||||
|
installRustc = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
enable-servers-module =
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
options,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
disabled =
|
disabled =
|
||||||
(lib.optionals pkgs.stdenv.isDarwin [
|
lib.optionals pkgs.stdenv.isDarwin [
|
||||||
"fsautocomplete"
|
"fsautocomplete"
|
||||||
])
|
]
|
||||||
++ (lib.optionals pkgs.stdenv.isAarch64 [
|
++ lib.optionals pkgs.stdenv.isAarch64 [
|
||||||
# Broken
|
# Broken
|
||||||
"scheme_langserver"
|
"scheme_langserver"
|
||||||
])
|
]
|
||||||
++ (lib.optionals (pkgs.stdenv.hostPlatform.system == "aarch64-linux") [
|
++ lib.optionals (pkgs.stdenv.hostPlatform.system == "aarch64-linux") [
|
||||||
# Binary package not available for this architecture
|
# Binary package not available for this architecture
|
||||||
"starpls"
|
"starpls"
|
||||||
# TODO: 2024-10-05 build failure
|
# TODO: 2024-10-05 build failure
|
||||||
"fstar"
|
"fstar"
|
||||||
])
|
]
|
||||||
++ (lib.optionals (pkgs.stdenv.hostPlatform.system == "x86_64-darwin") [
|
++ lib.optionals (pkgs.stdenv.hostPlatform.system == "x86_64-darwin") [
|
||||||
# Binary package not available for this architecture
|
# Binary package not available for this architecture
|
||||||
"starpls"
|
"starpls"
|
||||||
]);
|
];
|
||||||
|
|
||||||
renamed = lib.attrNames (import ../plugins/lsp/language-servers/_renamed.nix);
|
|
||||||
in
|
in
|
||||||
lib.mkMerge [
|
{
|
||||||
(lib.pipe options.plugins.lsp.servers [
|
inherit _file;
|
||||||
|
|
||||||
|
plugins.lsp.servers = lib.pipe options.plugins.lsp.servers [
|
||||||
(lib.mapAttrs (
|
(lib.mapAttrs (
|
||||||
server: opts:
|
server: opts:
|
||||||
{
|
{
|
||||||
|
@ -41,13 +62,22 @@ pkgs.lib.optionalAttrs
|
||||||
// lib.optionalAttrs (opts ? package && !(opts.package ? default)) { package = null; }
|
// lib.optionalAttrs (opts ? package && !(opts.package ? default)) { package = null; }
|
||||||
))
|
))
|
||||||
(lib.filterAttrs (server: _: !(lib.elem server renamed)))
|
(lib.filterAttrs (server: _: !(lib.elem server renamed)))
|
||||||
])
|
|
||||||
{
|
|
||||||
rust_analyzer = {
|
|
||||||
installCargo = true;
|
|
||||||
installRustc = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
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
|
||||||
|
runCommandNoCCLocal name { } ''
|
||||||
|
touch $out
|
||||||
|
''
|
||||||
|
else
|
||||||
|
result.config.build.test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue