From 103ff2c8de75258d02eabc645032d93d8e050259 Mon Sep 17 00:00:00 2001 From: baku-ccron Date: Mon, 14 Sep 2026 12:18:43 +0000 Subject: [PATCH] Vendor crates through fetchCargoVendor cargoLock fetches every crate from crates.io/api, which now answers 403 to the curl User-Agent nix sends, so any store miss fails the build. fetchCargoVendor pulls from the static.crates.io CDN. Refs rainlanguage/rainix#377 Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN --- flake.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 67c1666..1d1c928 100644 --- a/flake.nix +++ b/flake.nix @@ -26,8 +26,15 @@ src = ./.; doCheck = false; name = "rain"; - cargoLock.lockFile = ./Cargo.lock; - cargoLock.allowBuiltinFetchGit = true; + # Vendored through fetchCargoVendor rather than cargoLock: cargoLock + # fetches each crate from crates.io/api, which answers 403 to the + # curl User-Agent nix sends, so any store miss fails the build. + # fetchCargoVendor pulls from the static.crates.io CDN. + cargoDeps = pkgs.rustPlatform.fetchCargoVendor { + src = ./.; + name = "rain"; + hash = "sha256-TrZzMmDnC07lhfjKdKfwNtrzbeRcxKewqTqmiZD2fic="; + }; buildInputs = rainix.rust-build-inputs.${system}; nativeBuildInputs = rainix.rust-build-inputs.${system}; };