plugins/rust-tools: Allow null serverPackage (#845)

Some users might want to use rust-analyzer beta/nightly from their own nix develop shell.
This commit is contained in:
Ryan 2023-12-28 04:33:01 +08:00 committed by GitHub
parent c11158c73e
commit b140981d65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,9 +14,9 @@ in {
enable = mkEnableOption "rust tools plugins";
package = helpers.mkPackageOption "rust-tools" pkgs.vimPlugins.rust-tools-nvim;
serverPackage = mkOption {
type = types.package;
type = with types; nullOr package;
default = pkgs.rust-analyzer;
description = "Package to use for rust-analyzer";
description = "Package to use for rust-analyzer. rust-analyzer will not be installed if this is set to `null`";
};
executor =
@ -133,7 +133,7 @@ in {
};
config = mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [nvim-lspconfig cfg.package];
extraPackages = [cfg.serverPackage];
extraPackages = optional (cfg.serverPackage != null) cfg.serverPackage;
plugins.lsp.postConfig = let
options =