about summary refs log tree commit diff
path: root/pkgs/development/tools/rust/cargo-audit
diff options
context:
space:
mode:
authorJamie Quigley <jamie@quigley.xyz>2022-06-19 17:41:16 +0100
committerJamie Quigley <jamie@quigley.xyz>2022-06-19 17:58:16 +0100
commit6f7502f325084646dbc9b04fb7e2fd9cace7b25b (patch)
treef9522af3e2b76d22a65fcc96d25dc4a2ea6efd0c /pkgs/development/tools/rust/cargo-audit
parente989490deecfa0319cb49953e81e69c19b9a9df2 (diff)
treewide: move all cargo subcommands to `pkgs/development/tools/rust/`
Diffstat (limited to 'pkgs/development/tools/rust/cargo-audit')
-rw-r--r--pkgs/development/tools/rust/cargo-audit/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/development/tools/rust/cargo-audit/default.nix b/pkgs/development/tools/rust/cargo-audit/default.nix
new file mode 100644
index 0000000000000..982a000caa74d
--- /dev/null
+++ b/pkgs/development/tools/rust/cargo-audit/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, rustPlatform
+, fetchFromGitHub
+, openssl
+, pkg-config
+, Security
+, libiconv
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-audit";
+  version = "0.17.0";
+
+  src = fetchFromGitHub {
+    owner = "RustSec";
+    repo = "rustsec";
+    rev = "cargo-audit%2Fv${version}";
+    sha256 = "sha256-x91x5XjIRXLhs96r06ITbpHCkHoaCaMXH+VCp6f57Gg=";
+  };
+
+  cargoSha256 = "sha256-/CzRkdo4kfvRwOZsfyu0zL3UnjEKCBj7wj40jlydSDI=";
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    openssl
+    libiconv
+  ] ++ lib.optionals stdenv.isDarwin [
+    Security
+  ];
+
+  buildFeatures = [ "fix" ];
+
+  # 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 /* or */ asl20 ];
+    maintainers = with maintainers; [ basvandijk jk ];
+  };
+}