-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fetchurlBoot: Use Nix's builtin fetchurl function
This removes the need for curl in bootstrapTools, and enables https for bootstrap tarballs.
- Loading branch information
Showing
3 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
let mirrors = import ./mirrors.nix; in | ||
|
||
{ system }: | ||
|
||
{ url ? builtins.head urls | ||
, urls ? [] | ||
, sha256 | ||
}: | ||
|
||
import <nix/fetchurl.nix> { | ||
inherit system sha256; | ||
|
||
url = | ||
# Handle mirror:// URIs. Since <nix/fetchurl.nix> currently | ||
# supports only one URI, use the first listed mirror. | ||
let m = builtins.match "mirror://([a-z]+)/(.*)" url; in | ||
if m == null then url | ||
else builtins.head (mirrors.${builtins.elemAt m 0}) + (builtins.elemAt m 1); | ||
|
||
} |
This file contains 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
This file contains 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