Skip to content

Commit 961b3a1

Browse files
committed
builtin:fetch-tree: Propagate access tokens, set cache directory
1 parent 94facc9 commit 961b3a1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/libfetchers/builtin.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@ static void builtinFetchTree(const BuiltinBuilderContext & ctx)
2020
if (!ctx.structuredAttrs)
2121
throw Error("'builtin:fetch-tree' must have '__structuredAttrs = true'");
2222

23+
setenv("NIX_CACHE_HOME", ctx.tmpDirInSandbox.c_str(), 1);
24+
2325
using namespace fetchers;
2426

25-
fetchers::Settings fetchSettings;
27+
fetchers::Settings myFetchSettings;
28+
myFetchSettings.accessTokens = fetchSettings.accessTokens.get();
29+
30+
// FIXME: disable use of the git/tarball cache
31+
32+
auto input = Input::fromAttrs(myFetchSettings, jsonToAttrs((*ctx.structuredAttrs)["input"]));
2633

27-
auto input = Input::fromAttrs(fetchSettings, jsonToAttrs((*ctx.structuredAttrs)["input"]));
34+
std::cerr << fmt("fetching '%s'...\n", input.to_string());
2835

2936
/* Make sure we don't use the real store because we're in a forked
3037
process. */

0 commit comments

Comments
 (0)