feat: make rust lsp install optional

This commit is contained in:
Ching Pei Yang 2023-09-14 23:55:11 +02:00
parent 3907c61f9b
commit 3ca97bccbc

View file

@ -30,7 +30,7 @@ in {
package = mkOption {
description = "rust-analyzer package";
type = types.package;
type = with types; either package (listOf str);
default = pkgs.rust-analyzer;
};
@ -118,7 +118,11 @@ in {
server = {
capabilities = capabilities,
on_attach = rust_on_attach,
cmd = {"${cfg.lsp.package}/bin/rust-analyzer"},
cmd = ${
if isList cfg.lsp.package
then nvim.lua.expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/rust-analyzer"}''
},
settings = {
${cfg.lsp.opts}
}