about summary refs log tree commit diff
path: root/src/libstore/store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/store.cc')
-rw-r--r--src/libstore/store.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstore/store.cc b/src/libstore/store.cc
index 25e2d6e36009..94c992f22936 100644
--- a/src/libstore/store.cc
+++ b/src/libstore/store.cc
@@ -82,12 +82,14 @@ void openDB(bool reserveSpace)
 
     try {
         Path reservedPath = nixDBPath + "/reserved";
-        off_t reservedSize = 1024 * 1024;
+        string s = querySetting("gc-reserved-space", "");
+        int reservedSize;
+        if (!string2Int(s, reservedSize)) reservedSize = 1024 * 1024;
         if (reserveSpace) {
             struct stat st;
             if (stat(reservedPath.c_str(), &st) == -1 ||
                 st.st_size != reservedSize)
-                writeFile(reservedPath, string(1024 * 1024, 'X'));
+                writeFile(reservedPath, string(reservedSize, 'X'));
         }
         else
             deletePath(reservedPath);