devShell: add clippy and rustfmt from the current toolchain (#432)

This commit is contained in:
Ivan Petkov 2023-10-17 00:24:15 +00:00 committed by GitHub
parent 159f71f4f0
commit f2b70c85d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 6 deletions

View File

@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* `craneUtils` will now be built with the `rustPlatform` provided by nixpkgs
instead of the currently configured toolchain. This should hopefully result in
fewer surprises for those testing with really old MSRV toolchains.
* `devShell` will now additionally include `clippy` and `rustfmt` from the
currently configured toolchain
## [0.14.2] - 2023-10-15

View File

@ -780,6 +780,9 @@ attributes are passed straight through, so any `mkShell` behavior can be used
as expected: namely, all key-value pairs other than those `mkShell` consumes
will be set as environment variables in the resulting shell.
Note that the current toolchain's `cargo`, `clippy`, `rustc`, and `rustfmt`
packages will automatically be added to the devShell.
#### Optional attributes
* `checks`: A set of checks to inherit inputs from, typically
`self.checks.${system}`. Build inputs from the values in this attribute set

View File

@ -1,6 +1,8 @@
{ cargo
, clippy
, mkShell
, rustc
, rustfmt
}:
{ checks ? { }
@ -20,10 +22,10 @@ in
mkShell (cleanedArgs // {
inputsFrom = builtins.attrValues checks ++ inputsFrom;
packages =
[
rustc
cargo
]
++ packages;
packages = [
rustc
cargo
clippy
rustfmt
] ++ packages;
})