Index: nix/src/libmain/shared.cc
===================================================================
--- nix/src/libmain/shared.cc	(revision 28406)
+++ nix/src/libmain/shared.cc	(working copy)
@@ -7,6 +7,7 @@
 #include "misc.hh"
 
 #include <iostream>
+#include <fstream>
 #include <cctype>
 #include <exception>
 
@@ -251,6 +252,20 @@
             string value = *i;
             overrideSetting(name, tokenizeString(value));
         }
+        else if (arg == "--from-file") {
+            ++i;
+            if (i == args.end()) throw UsageError("`--from-file' requires an argument");
+            std::ifstream argFile;
+            argFile.open(i->c_str());
+            if (argFile.fail()) {
+                throw Error(format("failed to open option file `%1%'") % *i);
+            }
+            string fileArg;
+            while (argFile >> fileArg) {
+                args.push_back(fileArg);
+            }
+            argFile.close();
+        }
         else remaining.push_back(arg);
     }
 
