From 6441a16a246fb3dccc925a0b7790982d620e5042 Mon Sep 17 00:00:00 2001 From: emaryn Date: Thu, 17 Apr 2025 22:56:43 +0800 Subject: [PATCH] cargo-vet: refactor --- .../tools/rust/cargo-vet/default.nix | 24 +++++++------------ pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-vet/default.nix b/pkgs/development/tools/rust/cargo-vet/default.nix index 6ab35add1fff..25bde7e2bbd2 100644 --- a/pkgs/development/tools/rust/cargo-vet/default.nix +++ b/pkgs/development/tools/rust/cargo-vet/default.nix @@ -2,43 +2,37 @@ lib, rustPlatform, fetchFromGitHub, - stdenv, - Security, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "cargo-vet"; version = "0.10.1"; src = fetchFromGitHub { owner = "mozilla"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-HSEhFCcdC79OA8MP73De+iLIjcr1XMHxfJ9a1Q3JJYI="; + repo = "cargo-vet"; + tag = "v${finalAttrs.version}"; + hash = "sha256-HSEhFCcdC79OA8MP73De+iLIjcr1XMHxfJ9a1Q3JJYI="; }; useFetchCargoVendor = true; cargoHash = "sha256-+X6DLxWPWMcGzJMVZAj3C5P5MyywIb4ml0Jsyo9/uAE="; - buildInputs = lib.optional stdenv.hostPlatform.isDarwin Security; - # the test_project tests require internet access - checkFlags = [ - "--skip=test_project" - ]; + checkFlags = [ "--skip=test_project" ]; - meta = with lib; { + meta = { description = "Tool to help projects ensure that third-party Rust dependencies have been audited by a trusted source"; mainProgram = "cargo-vet"; homepage = "https://mozilla.github.io/cargo-vet"; - license = with licenses; [ + license = with lib.licenses; [ asl20 # or mit ]; - maintainers = with maintainers; [ + maintainers = with lib.maintainers; [ figsoda jk matthiasbeyer ]; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index efd4f3ec464f..f4f11184c279 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7009,9 +7009,7 @@ with pkgs; cargo-udeps = callPackage ../development/tools/rust/cargo-udeps { inherit (darwin.apple_sdk.frameworks) CoreServices Security SystemConfiguration; }; - cargo-vet = callPackage ../development/tools/rust/cargo-vet { - inherit (darwin.apple_sdk.frameworks) Security; - }; + cargo-vet = callPackage ../development/tools/rust/cargo-vet { }; cargo-watch = callPackage ../development/tools/rust/cargo-watch { inherit (darwin.apple_sdk.frameworks) Foundation Cocoa; };