about summary refs log tree commit diff
path: root/src/libstore/builtins.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/builtins.cc')
-rw-r--r--src/libstore/builtins.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libstore/builtins.cc b/src/libstore/builtins.cc
index a30f30906f01..c5dbd57f8bc6 100644
--- a/src/libstore/builtins.cc
+++ b/src/libstore/builtins.cc
@@ -6,8 +6,16 @@
 
 namespace nix {
 
-void builtinFetchurl(const BasicDerivation & drv)
+void builtinFetchurl(const BasicDerivation & drv, const std::string & netrcData)
 {
+    /* Make the host's netrc data available. Too bad curl requires
+       this to be stored in a file. It would be nice if we could just
+       pass a pointer to the data. */
+    if (netrcData != "") {
+        settings.netrcFile = "netrc";
+        writeFile(settings.netrcFile, netrcData, 0600);
+    }
+
     auto getAttr = [&](const string & name) {
         auto i = drv.env.find(name);
         if (i == drv.env.end()) throw Error(format("attribute ‘%s’ missing") % name);