Conversation
This command fetches all inputs of a flake in parallel. Example runtime for $ chmod -R u+w /tmp/nix2; rm -rf /tmp/nix2; rm ~/.cache/nix/fetcher-cache-v3.sqlite*; rm -rf ~/.cache/nix/tarball-cache/ ~/.cache/nix/gitv3/; time nix flake prefetch-inputs --store /tmp/nix2 https://api.flakehub.com/f/pinned/informalsystems/cosmos.nix/0.3.0/018ce9ed-d0be-7ce5-81b6-a3c6e3ae1187/source.tar.gz with http-connections = 1: real 4m11.859s user 2m6.931s sys 0m25.619s and http-connections = 25 (the default): real 0m57.146s user 2m49.506s sys 0m36.008s
roberth
reviewed
Jul 30, 2025
| { | ||
| auto flake = lockFlake(); | ||
|
|
||
| ThreadPool pool{fileTransferSettings.httpConnections}; |
Member
There was a problem hiding this comment.
Using http-connections is weird if your inputs aren't all tarballs.
Looks like the setting needs to be generalized, or we should apply a different strategy.
Member
Author
There was a problem hiding this comment.
It's not perfect, but I didn't want to add another setting just for this command. http-connections is the closest to want we want to express here (i.e. an operation that is network-bound).
Member
Author
|
Team discussion:
|
roberth
approved these changes
Aug 20, 2025
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2025-08-20-nix-team-meeting-minutes-242-241/68245/1 |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This command fetches all inputs of a flake in parallel. This can be a lot faster than the serialized on-demand fetching during regular flake evaluation. The downside is that it may fetch inputs that aren't normally used.
Example runtime for
with
http-connections = 1:and
http-connections = 25(the default):Based on DeterminateSystems#127.
Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.