My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/infra/libkookie/nixpkgs/unstable/pkgs/build-support/fetchurl/boot.nix

20 lines
498 B

let mirrors = import ./mirrors.nix; in
{ system }:
{ url ? builtins.head urls
, urls ? []
, sha256
, name ? baseNameOf (toString url)
}:
import <nix/fetchurl.nix> {
inherit system sha256 name;
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);
}