Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using CDN for serving the nixpkgs flake just as we did with nix channels? #6975

Open
arianvp opened this issue Aug 30, 2022 · 7 comments
Labels
feature Feature request or proposal flakes

Comments

@arianvp
Copy link
Member

arianvp commented Aug 30, 2022

Is your feature request related to a problem? Please describe.
Fetching nixpkgs through flakes takes several minutes for me on gigabit internet because Github has very bad peering with many parts of the world or seems to for some reason throttle bandwidth to German IP addresses Whilst Nix channel updates are basically instant (Takes 1 second to fetch).

Describe the solution you'd like
nix run nixpkgs#hello does not fetch nixpkgs repo from Github's CDN but downloads nixexprs.tar.gz from a proper CDN like Fastly (Just like https://channels.nixos.org). Fastly (or other CDN) can take care of serving the flake contents quickly and efficiently which GitHub seems to not be good at in current state.

Similar to #6717

Describe alternatives you've considered
Stop using flakes because they are too slow to use with nixpkgs at the moment

Additional context
Add any other context or screenshots about the feature request here.

@arianvp
Copy link
Member Author

arianvp commented Aug 30, 2022

I'm not sure if this issue belongs to the nix repository per se or if it belongs to https://github.com/nixos/flake-registry

@SuperSandro2000
Copy link
Member

German internet strikes once again. Also downloading via the GitHub Api is not ideal when the IP is shared and one person quickly hits the rate limit.

@arianvp
Copy link
Member Author

arianvp commented Aug 31, 2022

I think in this case the problem is not German Internet but GitHub API not being super suitable for content Delivery . I don't have any problems with channels.nixos.org or cache.nixos.org

@fricklerhandwerk fricklerhandwerk added feature Feature request or proposal and removed improvement labels Sep 12, 2022
@arianvp
Copy link
Member Author

arianvp commented May 7, 2024

I now have nix flake update regularly fail for me. I ran nix flake update 10 times in 5 minutes and now GitHub has banned my IP

image

@a-kenji
Copy link
Contributor

a-kenji commented May 8, 2024

I am not sure if you are aware, but nix flake update is able to read nix configuration.

 export NIX_CONFIG="access-tokens = github.com=gho_******"

This doesn't solve the underlying problem, but you will have a much more generous access limit.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/seeking-solutions-for-nixos-api-rate-limiting-in-a-school-environment/54433/12

@arianvp
Copy link
Member Author

arianvp commented Feb 22, 2025

Solved by NixOS/infra#562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal flakes
Projects
None yet
Development

No branches or pull requests

6 participants