File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 52
52
{
53
53
package ? null ,
54
54
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 ,
55
57
} :
56
58
lib . mkOption {
57
59
type = mkServerSubmodule { inherit name package ; } ;
58
60
inherit description ;
59
61
default = { } ;
60
62
} ;
61
63
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 ) ;
66
76
in
67
77
{
68
78
options . lsp = {
81
91
servers = lib . mkOption {
82
92
type = types . submodule {
83
93
freeformType = types . attrsOf ( mkServerSubmodule { } ) ;
84
- options = builtins . mapAttrs mkServerOption serverSpecs ;
94
+ options = builtins . mapAttrs mkServerOption serverPackages ;
85
95
} ;
86
96
87
97
description = ''
You can’t perform that action at this time.
0 commit comments