Skip to content

Update flake.lock and fix 403 on crate.io - #376

Open
alberand wants to merge 1 commit into
serokell:masterfrom
alberand:fix-403
Open

alberand wants to merge 1 commit into
serokell:masterfrom
alberand:fix-403

Conversation

@alberand

Copy link
Copy Markdown

nixos-unstable has a work-around for crate.io returning 403 on the requests without user-agent. The Nix's rust package fetcher fetchCargoVendor uses python's requests library which doesn't set agent explicitly. From recently create.io returns 403 on such requests (upstream issues says that nixpkgs has exception but peoples seems to get 403 anyway). cargoLock uses uses fetchurl default curl user-agent which gets blocked by crate.io

@notgne2

notgne2 commented May 28, 2026

Copy link
Copy Markdown
Contributor

I believe there's a second PR that just got merged into nixpkgs to fix cargo lock usage, with a workaround that can be applied in this flake in the meantime too. Not a fan of adding the hash

@alberand

Copy link
Copy Markdown
Author

Will you update nixpkgs, or should I update this PR? (do you have a link for that fetchurl workaround? I didn't find it)

@notgne2

notgne2 commented May 28, 2026

Copy link
Copy Markdown
Contributor

https://github.com/NixOS/nixpkgs/pull/524985/changes this should be doable by putting it in extraRegistries instead, which can be done by using cargoDeps = rustPlatform.importCargoLock instead of cargoLock.lockFile. Not tested yet but do think this would probably fix it

@alberand

Copy link
Copy Markdown
Author

ah this one, yeah, doesn't seem to be in nixpkgs-unstable yet

nixos-unstable has a work-around for crate.io returning 403 on the
requests without user-agent. The Nix's rust package fetcher
fetchCargoVendor uses python's requests library which doesn't set agent
explicitly. From recently create.io returns 403 on such requests
(upstream issues says that nixpkgs has exception but peoples seems to
get 403 anyway). cargoLock uses uses fetchurl default curl user-agent
which gets blocked by crate.io
@alberand

alberand commented Jun 5, 2026

Copy link
Copy Markdown
Author

nixpkgs-unstable got updated, I updated MR as suggested and dropped flake-compact flake input update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants