From e9c50064b59de6e9b4167f578c15b0cc04a7d33e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 29 Feb 2016 18:15:20 +0100 Subject: 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 --- src/libexpr/common-opts.cc | 2 +- src/libexpr/parser.y | 2 +- src/libexpr/primops.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libexpr') diff --git a/src/libexpr/common-opts.cc b/src/libexpr/common-opts.cc index 68ab4b5cd..8a7989aac 100644 --- a/src/libexpr/common-opts.cc +++ b/src/libexpr/common-opts.cc @@ -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); diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index 80ecd44c5..11dc7bb5c 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -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)) { diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 3c899d769..5bfb95be6 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -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})); } -- cgit v1.2.3