Loading doc/release-notes/rl-2511.section.md +1 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,7 @@ <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. --> - Added `rewriteURL` attribute to the nixpkgs `config`, to allow for rewriting the URLs downloaded by `fetchurl`. - Added `hashedMirrors` attribute to the nixpkgs `config`, to allow for customization of the hashed mirrors used by `fetchurl`. - Added `gitConfig` and `gitConfigFile` option to the nixpkgs `config`, to allow for setting a default `gitConfigFile` for all `fetchgit` invocations. Loading pkgs/build-support/fetchurl/default.nix +4 −1 Original line number Diff line number Diff line Loading @@ -7,11 +7,14 @@ curl, # Note that `curl' may be `null', in case of the native stdenvNoCC. cacert ? null, rewriteURL, hashedMirrors, }: let mirrors = import ./mirrors.nix; mirrors = import ./mirrors.nix // { inherit hashedMirrors; }; # Write the list of mirrors to a file that we can reuse between # fetchurl instantiations, instead of passing the mirrors to Loading pkgs/build-support/fetchurl/mirrors.nix +1 −4 Original line number Diff line number Diff line { # Content-addressable Nix mirrors hashedMirrors = [ "https://tarballs.nixos.org" ]; hashedMirrors = throw "Use config.hashedMirrors instead of (import ./pkgs/build-support/fetchurl/mirrors.nix).hashedMirrors"; # Mirrors for mirror://site/filename URIs, where "site" is # "sourceforge", "gnu", etc. Loading pkgs/build-support/fetchurl/tests.nix +15 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,21 @@ ${jq}/bin/jq -r '.headers.Hello' $out | ${moreutils}/bin/sponge $out ''; }; # Tests that hashedMirrors works hashedMirrors = testers.invalidateFetcherByDrvHash fetchurl { # Make sure that we can only download from hashed mirrors url = "http://broken"; # A file with this hash is definitely on tarballs.nixos.org sha256 = "1j1y3cq6ys30m734axc0brdm2q9n2as4h32jws15r7w5fwr991km"; # No chance curlOptsList = [ "--retry" "0" ]; }; # Tests that downloadToTemp works with hashedMirrors no-skipPostFetch = testers.invalidateFetcherByDrvHash fetchurl { # Make sure that we can only download from hashed mirrors Loading @@ -40,6 +55,5 @@ # $downloadedFile, but here we know that because the URL is broken, it will # have to fallback to fetching the previously-built derivation from # tarballs.nixos.org, which provides pre-built derivation outputs. }; } pkgs/stdenv/darwin/default.nix +1 −1 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ let inherit lib; stdenvNoCC = prevStage.ccWrapperStdenv or thisStdenv; curl = bootstrapTools; inherit (config) rewriteURL; inherit (config) hashedMirrors rewriteURL; }; inherit cc; Loading Loading
doc/release-notes/rl-2511.section.md +1 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,7 @@ <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. --> - Added `rewriteURL` attribute to the nixpkgs `config`, to allow for rewriting the URLs downloaded by `fetchurl`. - Added `hashedMirrors` attribute to the nixpkgs `config`, to allow for customization of the hashed mirrors used by `fetchurl`. - Added `gitConfig` and `gitConfigFile` option to the nixpkgs `config`, to allow for setting a default `gitConfigFile` for all `fetchgit` invocations. Loading
pkgs/build-support/fetchurl/default.nix +4 −1 Original line number Diff line number Diff line Loading @@ -7,11 +7,14 @@ curl, # Note that `curl' may be `null', in case of the native stdenvNoCC. cacert ? null, rewriteURL, hashedMirrors, }: let mirrors = import ./mirrors.nix; mirrors = import ./mirrors.nix // { inherit hashedMirrors; }; # Write the list of mirrors to a file that we can reuse between # fetchurl instantiations, instead of passing the mirrors to Loading
pkgs/build-support/fetchurl/mirrors.nix +1 −4 Original line number Diff line number Diff line { # Content-addressable Nix mirrors hashedMirrors = [ "https://tarballs.nixos.org" ]; hashedMirrors = throw "Use config.hashedMirrors instead of (import ./pkgs/build-support/fetchurl/mirrors.nix).hashedMirrors"; # Mirrors for mirror://site/filename URIs, where "site" is # "sourceforge", "gnu", etc. Loading
pkgs/build-support/fetchurl/tests.nix +15 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,21 @@ ${jq}/bin/jq -r '.headers.Hello' $out | ${moreutils}/bin/sponge $out ''; }; # Tests that hashedMirrors works hashedMirrors = testers.invalidateFetcherByDrvHash fetchurl { # Make sure that we can only download from hashed mirrors url = "http://broken"; # A file with this hash is definitely on tarballs.nixos.org sha256 = "1j1y3cq6ys30m734axc0brdm2q9n2as4h32jws15r7w5fwr991km"; # No chance curlOptsList = [ "--retry" "0" ]; }; # Tests that downloadToTemp works with hashedMirrors no-skipPostFetch = testers.invalidateFetcherByDrvHash fetchurl { # Make sure that we can only download from hashed mirrors Loading @@ -40,6 +55,5 @@ # $downloadedFile, but here we know that because the URL is broken, it will # have to fallback to fetching the previously-built derivation from # tarballs.nixos.org, which provides pre-built derivation outputs. }; }
pkgs/stdenv/darwin/default.nix +1 −1 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ let inherit lib; stdenvNoCC = prevStage.ccWrapperStdenv or thisStdenv; curl = bootstrapTools; inherit (config) rewriteURL; inherit (config) hashedMirrors rewriteURL; }; inherit cc; Loading