mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 17:58:38 +02:00
nvim-lsp: add installLanguageServer option for servers
This commit is contained in:
parent
efdcbe225f
commit
21f2e43568
2 changed files with 13 additions and 4 deletions
|
@ -32,7 +32,7 @@
|
|||
then {
|
||||
package = mkOption {
|
||||
default = package;
|
||||
type = types.nullOr types.package;
|
||||
type = types.package;
|
||||
};
|
||||
}
|
||||
else {};
|
||||
|
@ -42,9 +42,18 @@
|
|||
{
|
||||
enable = mkEnableOption description;
|
||||
|
||||
installLanguageServer = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Whether nixvim should take care of installing the language server.";
|
||||
};
|
||||
|
||||
cmd = mkOption {
|
||||
type = with types; nullOr (listOf str);
|
||||
default = cmd cfg;
|
||||
default =
|
||||
if cfg.installLanguageServer
|
||||
then cmd cfg
|
||||
else null;
|
||||
};
|
||||
|
||||
filetypes = helpers.mkNullOrOption (types.listOf types.str) ''
|
||||
|
@ -103,7 +112,7 @@
|
|||
extraPackages =
|
||||
(
|
||||
optional
|
||||
((package != null) && (cfg.package != null))
|
||||
(cfg.installLanguageServer && (package != null))
|
||||
cfg.package
|
||||
)
|
||||
++ (mapAttrsToList (name: _: cfg."${name}Package") extraPackages);
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
# Do not install the language server using nixvim
|
||||
gopls = {
|
||||
enable = true;
|
||||
package = null;
|
||||
installLanguageServer = false;
|
||||
};
|
||||
nil_ls.enable = true;
|
||||
rust-analyzer.enable = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue