1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-04 15:31:47 +02:00

builtins.{fetchurl,fetchTarball}: Support a sha256 attribute

Also, allow builtins.{fetchurl,fetchTarball} in restricted mode if a
hash is specified.
This commit is contained in:
Eelco Dolstra 2016-07-26 21:16:52 +02:00
parent ee3032e4de
commit 06bbfb6004
3 changed files with 37 additions and 12 deletions

View file

@ -1,6 +1,7 @@
#pragma once
#include "types.hh"
#include "hash.hh"
#include <string>
@ -27,7 +28,8 @@ struct Downloader
{
virtual DownloadResult download(string url, const DownloadOptions & options) = 0;
Path downloadCached(ref<Store> store, const string & url, bool unpack);
Path downloadCached(ref<Store> store, const string & url, bool unpack,
const Hash & expectedHash = Hash());
enum Error { NotFound, Forbidden, Misc };
};