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
This commit is contained in:
copilot-swe-agent[bot] 2026-05-28 03:37:09 +00:00 committed by GitHub
parent 00e434fd63
commit 6b8b1e160c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;