mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
Add an HTTP binary cache store
Allowing stuff like NIX_REMOTE=https://cache.nixos.org nix-store -qR /nix/store/x1p1gl3a4kkz5ci0nfbayjqlqmczp1kq-geeqie-1.1 or NIX_REMOTE=https://cache.nixos.org nix-store --export /nix/store/x1p1gl3a4kkz5ci0nfbayjqlqmczp1kq-geeqie-1.1 | nix-store --import
This commit is contained in:
parent
6170bb474b
commit
e9c50064b5
7 changed files with 102 additions and 61 deletions
|
@ -55,7 +55,7 @@ bool parseSearchPathArg(Strings::iterator & i,
|
|||
Path lookupFileArg(EvalState & state, string s)
|
||||
{
|
||||
if (isUri(s))
|
||||
return downloadFileCached(state.store, s, true);
|
||||
return makeDownloader()->downloadCached(state.store, s, true);
|
||||
else if (s.size() > 2 && s.at(0) == '<' && s.at(s.size() - 1) == '>') {
|
||||
Path p = s.substr(1, s.size() - 2);
|
||||
return state.findFile(p);
|
||||
|
|
|
@ -613,7 +613,7 @@ void EvalState::addToSearchPath(const string & s, bool warn)
|
|||
}
|
||||
|
||||
if (isUri(path))
|
||||
path = downloadFileCached(store, path, true);
|
||||
path = makeDownloader()->downloadCached(store, path, true);
|
||||
|
||||
path = absPath(path);
|
||||
if (pathExists(path)) {
|
||||
|
|
|
@ -1703,7 +1703,7 @@ void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v,
|
|||
} else
|
||||
url = state.forceStringNoCtx(*args[0], pos);
|
||||
|
||||
Path res = downloadFileCached(state.store, url, unpack);
|
||||
Path res = makeDownloader()->downloadCached(state.store, url, unpack);
|
||||
mkString(v, res, PathSet({res}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue