about summary refs log tree commit diff
path: root/src/libmain
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-23T12·19+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-23T12·38+0200
commit887bb5fa5a5a7b8b91d371de1a5c8280f9505744 (patch)
tree2486f49317aded421a8a33d692960651fff8a437 /src/libmain
parent1993b10d1169b04b83443a9ef5d4e3e38667afeb (diff)
--version: Print some config info
Such as whether Nix is built with signed binary cache support, and the
location of the configuration file.
Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/shared.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 575fa339a86c..a6e8f352a0ab 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -243,6 +243,20 @@ void parseCmdLine(int argc, char * * argv,
 void printVersion(const string & programName)
 {
     std::cout << format("%1% (Nix) %2%") % programName % nixVersion << std::endl;
+    if (verbosity > lvlInfo) {
+        Strings cfg;
+#if HAVE_BOEHMGC
+        cfg.push_back("gc");
+#endif
+#if HAVE_SODIUM
+        cfg.push_back("signed-caches");
+#endif
+        std::cout << "Features: " << concatStringsSep(", ", cfg) << "\n";
+        std::cout << "Configuration file: " << settings.nixConfDir + "/nix.conf" << "\n";
+        std::cout << "Store directory: " << settings.nixStore << "\n";
+        std::cout << "State directory: " << settings.nixStateDir << "\n";
+        std::cout << "Database directory: " << settings.nixDBPath << "\n";
+    }
     throw Exit();
 }