diff --git a/pkgs/development/tools/rust/cargo-cyclonedx/default.nix b/pkgs/development/tools/rust/cargo-cyclonedx/default.nix new file mode 100644 index 000000000000..e004ea9a6e62 --- /dev/null +++ b/pkgs/development/tools/rust/cargo-cyclonedx/default.nix @@ -0,0 +1,51 @@ +{ lib +, stdenv +, rustPlatform +, fetchFromGitHub +, pkg-config +, openssl +, Security +, SystemConfiguration +, CoreFoundation +, curl +}: + +rustPlatform.buildRustPackage rec { + pname = "cargo-cyclonedx"; + version = "0.3.7"; + + src = fetchFromGitHub { + owner = "CycloneDX"; + repo = "cyclonedx-rust-cargo"; + rev = "${pname}-${version}"; + hash = "sha256-xr3YNjQp+XhIWIqJ1rPUyM9mbtWGExlFEj28/SB8vfE="; + }; + + cargoHash = "sha256-NsBY+wb4IAlKOMh5BMvT734z//Wp/s0zimm04v8pqyc="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + openssl + ] ++ lib.optionals stdenv.isDarwin [ + Security + SystemConfiguration + CoreFoundation + curl + ]; + + meta = with lib; { + description = "Creates CycloneDX Software Bill of Materials (SBOM) from Rust (Cargo) projects"; + longDescription = '' + The CycloneDX module for Rust (Cargo) creates a valid CycloneDX Software + Bill-of-Material (SBOM) containing an aggregate of all project + dependencies. CycloneDX is a lightweight SBOM specification that is + easily created, human and machine readable, and simple to parse. + ''; + homepage = "https://github.com/CycloneDX/cyclonedx-rust-cargo"; + license = licenses.asl20; + maintainers = with maintainers; [ nikstur ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 157d2d92f476..2229d6b30476 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14826,6 +14826,9 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration; }; cargo-criterion = callPackage ../development/tools/rust/cargo-criterion { }; + cargo-cyclonedx = callPackage ../development/tools/rust/cargo-cyclonedx { + inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration CoreFoundation; + }; cargo-deadlinks = callPackage ../development/tools/rust/cargo-deadlinks { inherit (darwin.apple_sdk.frameworks) Security; };