nixpkgs/pkgs/build-support/fetchfile/default.nix
2016-10-09 16:19:04 +02:00

12 lines
304 B
Nix

{stdenv}: {pathname, md5 ? "", sha256 ? ""}: stdenv.mkDerivation {
name = baseNameOf (toString pathname);
builder = ./builder.sh;
pathname = pathname;
} // if (sha256 == "") then {
md5 = (stdenv.lib.fetchMD5warn "fetchfile" pathname md5);
id = md5;
} else {
sha256 = sha256;
id = sha256;
}