fetchurl: Add hook for rewriting/filtering URLs

This allows on-the-fly rewriting of URLs before they are passed from
fetchurl (or fetchurlBoot) to curl.

The intended use is to allow inserting company-internal mirrors, or
working around company firewalls and similar network restrictions,
without having to extensively patch across all of nixpkgs. Instead,
users can pass a function in their nixpkgs that performs the necessary
URL rewrites.

Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
This commit is contained in:
Johan Herland 2025-06-02 14:24:11 +00:00
parent a1ba3c5c21
commit abda866f17
No known key found for this signature in database
8 changed files with 48 additions and 5 deletions

View file

@ -21,7 +21,7 @@
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
- Create the first release note entry in this section!
- Added `rewriteURL` attribute to the nixpkgs `config`, to allow for rewriting the URLs downloaded by `fetchurl`.
## Nixpkgs Library {#sec-nixpkgs-release-25.11-lib}