2021-07-14 22:03:04 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
|
|
|
, Security
|
|
|
|
, libiconv
|
|
|
|
}:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-audit";
|
2021-07-14 22:03:04 +00:00
|
|
|
version = "0.15.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RustSec";
|
2021-07-14 22:03:04 +00:00
|
|
|
repo = "rustsec";
|
|
|
|
rev = "cargo-audit%2Fv${version}";
|
|
|
|
sha256 = "0pvb1m9277ysjzydjvx7viybi6bd23ch7sbjyx1wnz45ahrmia1j";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
cargoSha256 = "0cf8kg8vhfqbrkm227rzyl3394n7fsqhqgq13qks7374h5d04haw";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
libiconv
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
Security
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
# enables `cargo audit fix`
|
|
|
|
cargoBuildFlags = [ "--features fix" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# The tests require network access which is not available in sandboxed Nix builds.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Audit Cargo.lock files for crates with security vulnerabilities";
|
|
|
|
homepage = "https://rustsec.org";
|
|
|
|
license = with licenses; [ mit asl20 ];
|
|
|
|
maintainers = with maintainers; [ basvandijk ];
|
|
|
|
};
|
|
|
|
}
|