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 for this change
I found myself needing a mock
wget
executable for a new package I'm working on to get itsconfigure
script working, and I discovered that several ad-hoc solutions for this already exist in thepreConfigure
phases of a few derivations innixpkgs
.Having a package for this removes a bit of duplicated code, but I think more significantly it makes life a little easier for authors of future packages that may find this useful (as I do in the package I'm currently working on), and provides a place to document the technique.
Future work
There is a slightly more complex variant of this in
xen
which, instead of just failing, implementswget
in a mock way that copies files from a local cache. It may be useful to expand this at some point to include a behavior along those lines.Things done
(nix.useChroot on NixOS,
or option
build-use-chroot
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)