Allow overriding the tarball fetcher #62
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/flake-compat#62
Loading…
Reference in a new issue
No description provided.
Delete branch "enobayram/master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change allows the caller to replace the
fetchTarball
used for fetching the inputs of the flake withpkgs.fetchzip
, which works as a drop-in replacement. The difference is thatbuiltins.fetchTarball
does the fetching at Nix evaluation time, whilepkgs.fetchzip
does the fetching at build time. The distinction becomes crucial when one attempts to build a flake output inside arecursive-nix
derivation. A vanillanix build ${someFlake}
or anix-build default.nix
using the currentflake-compat
will fail inside a recursive Nix whenfetchTarball
attempts to download the tarball, but the following derivation (using theflake-compat
from this PR) will successfully build (on a system withrecursive-nix
):In the above Nix expression, if you remove the
fetchTarball
argument from line 11, then the build will fail with:Building a flake recursively like this allows us to hide its evaluation inside a derivation, which can be a world of difference in some cases (see this discussion thread I've opened a few months ago where I've explained in detail how bad this can get).
This approach essentially allows us to get a kind of nix flake output evaluation caching as part of a larger Nix evaluation.
Pull request closed