mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/lsp: enable auto-installing rustfmt
This commit is contained in:
parent
b0ebcaa177
commit
aabbd60633
1 changed files with 13 additions and 2 deletions
|
@ -30,6 +30,16 @@ in
|
|||
|
||||
# TODO: make nullable
|
||||
rustcPackage = mkPackageOption pkgs "rustc" { };
|
||||
|
||||
installRustfmt = mkOption {
|
||||
type = with types; nullOr bool;
|
||||
default = null;
|
||||
example = true;
|
||||
description = "Whether to install `rustfmt`.";
|
||||
};
|
||||
|
||||
# TODO: make nullable
|
||||
rustfmtPackage = mkPackageOption pkgs "rustfmt" { };
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
warnings =
|
||||
|
@ -56,7 +66,8 @@ in
|
|||
|
||||
extraPackages =
|
||||
with pkgs;
|
||||
(optional ((isBool cfg.installCargo) && cfg.installCargo) cfg.cargoPackage)
|
||||
++ (optional ((isBool cfg.installRustc) && cfg.installRustc) cfg.rustcPackage);
|
||||
optional (isBool cfg.installCargo && cfg.installCargo) cfg.cargoPackage
|
||||
++ optional (isBool cfg.installRustc && cfg.installRustc) cfg.rustcPackage
|
||||
++ optional (isBool cfg.installRustfmt && cfg.installRustfmt) cfg.rustfmtPackage;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue