From 6b8b1e160cba2b1d03e4b202c1e00c87c4f7a5d6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 28 May 2026 03:37:09 +0000 Subject: [PATCH] fix(nix): use cargoLock with static.crates.io CDN to fix 403 errors Revert cargoHash back to cargoLock (no hash updates needed on cargo update) and use extraRegistries to override the download URL to static.crates.io CDN, avoiding the rate-limited crates.io API endpoint that returns intermittent 403 errors. This is the same fix as NixOS/nixpkgs#524985 but applied locally via extraRegistries override, so it works without updating nixpkgs. See: https://github.com/rust-lang/crates.io/issues/13482 --- nix/yazi-unwrapped.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nix/yazi-unwrapped.nix b/nix/yazi-unwrapped.nix index 7145ecb9..b3797b62 100644 --- a/nix/yazi-unwrapped.nix +++ b/nix/yazi-unwrapped.nix @@ -26,7 +26,16 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "yazi"; inherit version src; - cargoHash = "sha256-EnxhbS+FO3MPKmNkh30x2Wwyf23CgZ/6B+guAwRq32Y="; + cargoLock = { + lockFile = "${src}/Cargo.lock"; + # Use static.crates.io (CDN) instead of crates.io/api to avoid the 1 req/sec + # rate limit which currently returns intermittent 403s. + # See https://github.com/rust-lang/crates.io/issues/13482 + # This override can be removed once nixpkgs includes NixOS/nixpkgs#524985. + extraRegistries = { + "https://github.com/rust-lang/crates.io-index" = "https://static.crates.io/crates"; + }; + }; env = { YAZI_GEN_COMPLETIONS = true;