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:
parent
ee3032e4de
commit
06bbfb6004
3 changed files with 37 additions and 12 deletions
|
@ -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 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue