From 22527bac638d1d324333a2a6e4a4ac951fb2e1e4 Mon Sep 17 00:00:00 2001 From: figsoda Date: Mon, 29 Dec 2025 21:42:46 -0500 Subject: [PATCH] fetchCargoTarball -> fetchCargoVendor rustPlatform.fetchCargoTarball was removed in nixpkgs 25.05 fixes #619 --- src/lang/rust/mod.rs | 2 +- src/main.rs | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lang/rust/mod.rs b/src/lang/rust/mod.rs index 06703fb6..25322a60 100644 --- a/src/lang/rust/mod.rs +++ b/src/lang/rust/mod.rs @@ -50,7 +50,7 @@ pub async fn cargo_deps_hash( if has_cargo_lock { let (hash, _) = tokio::join!( fod_hash(format!( - r#"(import({nixpkgs}){{}}).rustPlatform.fetchCargoTarball{{name="{pname}-{version}";src={src};hash="{FAKE_HASH}";}}"#, + r#"(import({nixpkgs}){{}}).rustPlatform.fetchCargoVendor{{pname="{pname}";version="{version}";src={src};hash="{FAKE_HASH}";}}"#, )), async { if let Some(lock) = resolve_workspace(src_dir) { diff --git a/src/main.rs b/src/main.rs index eeb5b6e9..abe0086c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -660,9 +660,8 @@ async fn run() -> Result<()> { RustVendorData::Hash(hash) => { write!(out, " ")?; writedoc! {out, r#" - cargoDeps = rustPlatform.fetchCargoTarball {{ - inherit src; - name = "${{pname}}-${{version}}"; + cargoDeps = rustPlatform.fetchCargoVendor {{ + inherit pname version src; hash = "{hash}"; }}; @@ -773,9 +772,8 @@ async fn run() -> Result<()> { src = {src_expr}; - cargoDeps = rustPlatform.fetchCargoTarball {{ - inherit src; - name = "${{pname}}-${{version}}"; + cargoDeps = rustPlatform.fetchCargoVendor {{ + inherit pname version src; hash = "{hash}"; }};