Skip to content

Commit 188df42

Browse files
committed
wip - start using lsp-packages.nix
1 parent bd1f143 commit 188df42

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

modules/lsp/default.nix

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,27 @@ let
5252
{
5353
package ? null,
5454
description ? "The ${name} language server.",
55+
# lsp-packages.nix tracks some custom commands, however this is currently not used by the server submodule
56+
cmd ? null,
5557
}:
5658
lib.mkOption {
5759
type = mkServerSubmodule { inherit name package; };
5860
inherit description;
5961
default = { };
6062
};
6163

62-
# TODO: generate package defaults from lsp-packages.nix
63-
serverSpecs = {
64-
nixd.package = "nixd";
65-
};
64+
# Combine `packages` and `customCmd` sets from `lsp-packages.nix`
65+
# We use this set to generate the package-option defaults
66+
serverPackages =
67+
(
68+
{
69+
unpackaged,
70+
packages,
71+
customCmd,
72+
}:
73+
builtins.mapAttrs (_: package: { inherit package; }) packages // customCmd
74+
)
75+
(import ../../plugins/lsp/lsp-packages.nix);
6676
in
6777
{
6878
options.lsp = {
@@ -81,7 +91,7 @@ in
8191
servers = lib.mkOption {
8292
type = types.submodule {
8393
freeformType = types.attrsOf (mkServerSubmodule { });
84-
options = builtins.mapAttrs mkServerOption serverSpecs;
94+
options = builtins.mapAttrs mkServerOption serverPackages;
8595
};
8696

8797
description = ''

0 commit comments

Comments
 (0)