diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index cdf56e09d69ad7f788e24e6557394182b89f8f66..8fe278d02e40fac819014b26f621bae615e125dc 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -34,6 +34,10 @@ DownloadSettings downloadSettings;
 
 static GlobalConfig::Register r1(&downloadSettings);
 
+CachedDownloadRequest::CachedDownloadRequest(const std::string & uri)
+    : uri(uri), ttl(settings.tarballTtl)
+{ }
+
 std::string resolveUri(const std::string & uri)
 {
     if (uri.compare(0, 8, "channel:") == 0)
diff --git a/src/libstore/download.hh b/src/libstore/download.hh
index 68565bf462a7e0181be0d91318622cd29eaaf72d..5a131c70450f9d17689948e27a8f19377df2db68 100644
--- a/src/libstore/download.hh
+++ b/src/libstore/download.hh
@@ -2,7 +2,7 @@
 
 #include "types.hh"
 #include "hash.hh"
-#include "globals.hh"
+#include "config.hh"
 
 #include <string>
 #include <future>
@@ -71,10 +71,10 @@ struct CachedDownloadRequest
     bool unpack = false;
     std::string name;
     Hash expectedHash;
-    unsigned int ttl = settings.tarballTtl;
+    unsigned int ttl;
 
-    CachedDownloadRequest(const std::string & uri)
-        : uri(uri) { }
+    CachedDownloadRequest(const std::string & uri);
+    CachedDownloadRequest() = delete;
 };
 
 struct CachedDownloadResult