diff --git a/.gitignore b/.gitignore
index ad56841231313f11b8e264b95da37c45a3fed12c..9830265701d834fbf98a29921a85774fc96166fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,6 +49,9 @@ perl/Makefile.config
 # /src/libstore/
 *.gen.*
 
+# /src/libutil/
+/src/libutil/tests/libutil-tests
+
 /src/nix/nix
 
 # /src/nix-env/
diff --git a/doc/manual/command-ref/opt-common-syn.xml b/doc/manual/command-ref/opt-common-syn.xml
index b610b54b96202ce033bbba185b46a7642f341e7f..2660e3bb1cca8daf2e136cdfb0ad1432094658f9 100644
--- a/doc/manual/command-ref/opt-common-syn.xml
+++ b/doc/manual/command-ref/opt-common-syn.xml
@@ -1,5 +1,5 @@
 <nop xmlns="http://docbook.org/ns/docbook">
-  
+
 <arg><option>--help</option></arg>
 <arg><option>--version</option></arg>
 <arg rep='repeat'>
@@ -11,6 +11,10 @@
 <arg>
   <arg choice='plain'><option>--quiet</option></arg>
 </arg>
+<arg>
+  <option>--log-format</option>
+  <replaceable>format</replaceable>
+</arg>
 <arg>
   <group choice='plain'>
     <arg choice='plain'><option>--no-build-output</option></arg>
diff --git a/doc/manual/command-ref/opt-common.xml b/doc/manual/command-ref/opt-common.xml
index 0383bfaedf151ebe011438bd1c1b36cccb23e82f..a68eef1d0e7636ed1c4823d104f9cb4cd0513e2d 100644
--- a/doc/manual/command-ref/opt-common.xml
+++ b/doc/manual/command-ref/opt-common.xml
@@ -92,6 +92,37 @@
 </varlistentry>
 
 
+<varlistentry xml:id="opt-log-format"><term><option>--log-format</option> <replaceable>format</replaceable></term>
+
+  <listitem>
+
+  <para>This option can be used to change the output of the log format, with
+  <replaceable>format</replaceable> being one of:</para>
+
+  <variablelist>
+
+    <varlistentry><term>raw</term>
+    <listitem><para>This is the raw format, as outputted by nix-build.</para></listitem>
+    </varlistentry>
+
+    <varlistentry><term>internal-json</term>
+    <listitem><para>Outputs the logs in a structured manner. NOTE: the json schema is not guarantees to be stable between releases.</para></listitem>
+    </varlistentry>
+
+    <varlistentry><term>bar</term>
+    <listitem><para>Only display a progress bar during the builds.</para></listitem>
+    </varlistentry>
+
+    <varlistentry><term>bar-with-logs</term>
+    <listitem><para>Display the raw logs, with the progress bar at the bottom.</para></listitem>
+    </varlistentry>
+
+  </variablelist>
+
+  </listitem>
+
+</varlistentry>
+
 <varlistentry><term><option>--no-build-output</option> / <option>-Q</option></term>
 
   <listitem><para>By default, output written by builders to standard
diff --git a/mk/libraries.mk b/mk/libraries.mk
index 307e29b9d05b84403f63db569cde8a0eb2510715..e6ef2e3ec7dd7644d2dd94f64e3180d66ee608d0 100644
--- a/mk/libraries.mk
+++ b/mk/libraries.mk
@@ -125,7 +125,8 @@ define build-library
     $(1)_PATH := $$(_d)/$$($(1)_NAME).a
 
     $$($(1)_PATH): $$($(1)_OBJS) | $$(_d)/
-	$(trace-ar) $(AR) crs $$@ $$?
+	$(trace-ld) $(LD) -Ur -o $$(_d)/$$($(1)_NAME).o $$?
+	$(trace-ar) $(AR) crs $$@ $$(_d)/$$($(1)_NAME).o
 
     $(1)_LDFLAGS_USE += $$($(1)_PATH) $$($(1)_LDFLAGS)
 
diff --git a/perl/lib/Nix/Store.xs b/perl/lib/Nix/Store.xs
index 890310b3e80fc5af3d7a10cc7dfdf7af257a8d34..945ed49c75432041fa59a7ee704a0d8a241a49db 100644
--- a/perl/lib/Nix/Store.xs
+++ b/perl/lib/Nix/Store.xs
@@ -80,7 +80,7 @@ SV * queryReferences(char * path)
 SV * queryPathHash(char * path)
     PPCODE:
         try {
-            auto s = store()->queryPathInfo(store()->parseStorePath(path))->narHash.to_string();
+            auto s = store()->queryPathInfo(store()->parseStorePath(path))->narHash.to_string(Base32, true);
             XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0)));
         } catch (Error & e) {
             croak("%s", e.what());
@@ -106,7 +106,7 @@ SV * queryPathInfo(char * path, int base32)
                 XPUSHs(&PL_sv_undef);
             else
                 XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(*info->deriver).c_str(), 0)));
-            auto s = info->narHash.to_string(base32 ? Base32 : Base16);
+            auto s = info->narHash.to_string(base32 ? Base32 : Base16, true);
             XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0)));
             mXPUSHi(info->registrationTime);
             mXPUSHi(info->narSize);
diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc
index af3b61d6a5cda456e8611a770a7431e9bfe47fd2..5a86fb625b1badc23db812824ac273441dda1179 100644
--- a/src/libexpr/primops/fetchTree.cc
+++ b/src/libexpr/primops/fetchTree.cc
@@ -23,7 +23,7 @@ void emitTreeAttrs(
 
     assert(tree.info.narHash);
     mkString(*state.allocAttr(v, state.symbols.create("narHash")),
-        tree.info.narHash.to_string(SRI));
+        tree.info.narHash.to_string(SRI, true));
 
     if (input->getRev()) {
         mkString(*state.allocAttr(v, state.symbols.create("rev")), input->getRev()->gitRev());
@@ -151,7 +151,7 @@ static void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v,
             : hashFile(htSHA256, path);
         if (hash != *expectedHash)
             throw Error((unsigned int) 102, "hash mismatch in file downloaded from '%s':\n  wanted: %s\n  got:    %s",
-                *url, expectedHash->to_string(), hash.to_string());
+                *url, expectedHash->to_string(Base32, true), hash.to_string(Base32, true));
     }
 
     if (state.allowedPaths)
diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc
index 94ac30e380042f09fa377925494f0e8899f1a624..ca555114da122f46ce8796cd4e21ae4587419dca 100644
--- a/src/libfetchers/fetchers.cc
+++ b/src/libfetchers/fetchers.cc
@@ -47,7 +47,7 @@ Attrs Input::toAttrs() const
 {
     auto attrs = toAttrsInternal();
     if (narHash)
-        attrs.emplace("narHash", narHash->to_string(SRI));
+        attrs.emplace("narHash", narHash->to_string(SRI, true));
     attrs.emplace("type", type());
     return attrs;
 }
@@ -67,7 +67,7 @@ std::pair<Tree, std::shared_ptr<const Input>> Input::fetchTree(ref<Store> store)
 
     if (narHash && narHash != input->narHash)
         throw Error("NAR hash mismatch in input '%s' (%s), expected '%s', got '%s'",
-            to_string(), tree.actualPath, narHash->to_string(SRI), input->narHash->to_string(SRI));
+            to_string(), tree.actualPath, narHash->to_string(SRI, true), input->narHash->to_string(SRI, true));
 
     return {std::move(tree), input};
 }
diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc
index b6e57379bd03753ec2a7cd0f606434e01b1fe14a..1b0eba18a0872fc82293f9eb9c30e0fc681830ab 100644
--- a/src/libfetchers/tarball.cc
+++ b/src/libfetchers/tarball.cc
@@ -196,9 +196,9 @@ struct TarballInput : Input
         // NAR hashes are preferred over file hashes since tar/zip files
         // don't have a canonical representation.
         if (narHash)
-            url2.query.insert_or_assign("narHash", narHash->to_string(SRI));
+            url2.query.insert_or_assign("narHash", narHash->to_string(SRI, true));
         else if (hash)
-            url2.query.insert_or_assign("hash", hash->to_string(SRI));
+            url2.query.insert_or_assign("hash", hash->to_string(SRI, true));
         return url2;
     }
 
@@ -207,7 +207,7 @@ struct TarballInput : Input
         Attrs attrs;
         attrs.emplace("url", url.to_string());
         if (hash)
-            attrs.emplace("hash", hash->to_string(SRI));
+            attrs.emplace("hash", hash->to_string(SRI, true));
         return attrs;
     }
 
diff --git a/src/libmain/common-args.cc b/src/libmain/common-args.cc
index 51e199ea5ceeadd63fe2df1f6b947df0388a39b3..051668e53a20d0a2ca53f12bcd52d6943c96e20c 100644
--- a/src/libmain/common-args.cc
+++ b/src/libmain/common-args.cc
@@ -1,5 +1,6 @@
 #include "common-args.hh"
 #include "globals.hh"
+#include "loggers.hh"
 
 namespace nix {
 
@@ -38,6 +39,14 @@ MixCommonArgs::MixCommonArgs(const string & programName)
         }},
     });
 
+    addFlag({
+        .longName = "log-format",
+        .description = "format of log output; \"raw\", \"internal-json\", \"bar\" "
+                        "or \"bar-with-logs\"",
+        .labels = {"format"},
+        .handler = {[](std::string format) { setLogFormat(format); }},
+    });
+
     addFlag({
         .longName = "max-jobs",
         .shortName = 'j',
diff --git a/src/libmain/loggers.cc b/src/libmain/loggers.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c44bb640869a626c15792ffdffdf28fbb7e18ef7
--- /dev/null
+++ b/src/libmain/loggers.cc
@@ -0,0 +1,52 @@
+#include "loggers.hh"
+#include "progress-bar.hh"
+
+namespace nix {
+
+LogFormat defaultLogFormat = LogFormat::raw;
+
+LogFormat parseLogFormat(const std::string & logFormatStr) {
+    if (logFormatStr == "raw")
+        return LogFormat::raw;
+    else if (logFormatStr == "raw-with-logs")
+        return LogFormat::rawWithLogs;
+    else if (logFormatStr == "internal-json")
+        return LogFormat::internalJson;
+    else if (logFormatStr == "bar")
+        return LogFormat::bar;
+    else if (logFormatStr == "bar-with-logs")
+        return LogFormat::barWithLogs;
+    throw Error("option 'log-format' has an invalid value '%s'", logFormatStr);
+}
+
+Logger * makeDefaultLogger() {
+    switch (defaultLogFormat) {
+    case LogFormat::raw:
+        return makeSimpleLogger(false);
+    case LogFormat::rawWithLogs:
+        return makeSimpleLogger(true);
+    case LogFormat::internalJson:
+        return makeJSONLogger(*makeSimpleLogger());
+    case LogFormat::bar:
+        return makeProgressBar();
+    case LogFormat::barWithLogs:
+        return makeProgressBar(true);
+    default:
+        abort();
+    }
+}
+
+void setLogFormat(const std::string & logFormatStr) {
+    setLogFormat(parseLogFormat(logFormatStr));
+}
+
+void setLogFormat(const LogFormat & logFormat) {
+    defaultLogFormat = logFormat;
+    createDefaultLogger();
+}
+
+void createDefaultLogger() {
+    logger = makeDefaultLogger();
+}
+
+}
diff --git a/src/libmain/loggers.hh b/src/libmain/loggers.hh
new file mode 100644
index 0000000000000000000000000000000000000000..cada0311049feb32d8ac74fbb1727cad09b6a0a0
--- /dev/null
+++ b/src/libmain/loggers.hh
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "types.hh"
+
+namespace nix {
+
+enum class LogFormat {
+  raw,
+  rawWithLogs,
+  internalJson,
+  bar,
+  barWithLogs,
+};
+
+void setLogFormat(const std::string & logFormatStr);
+void setLogFormat(const LogFormat & logFormat);
+
+void createDefaultLogger();
+
+}
diff --git a/src/nix/progress-bar.cc b/src/libmain/progress-bar.cc
similarity index 98%
rename from src/nix/progress-bar.cc
rename to src/libmain/progress-bar.cc
index 2fe26a0015f6d1a34a069fe57887386d94fb866f..20d9915a089698e255df7c69ef2acf9adf4721c5 100644
--- a/src/nix/progress-bar.cc
+++ b/src/libmain/progress-bar.cc
@@ -106,7 +106,7 @@ public:
         updateThread.join();
     }
 
-    void stop()
+    void stop() override
     {
         auto state(state_.lock());
         if (!state->active) return;
@@ -119,6 +119,10 @@ public:
         quitCV.notify_one();
     }
 
+    bool isVerbose() override {
+        return printBuildLogs;
+    }
+
     void log(Verbosity lvl, const FormatOrString & fs) override
     {
         auto state(state_.lock());
@@ -164,7 +168,7 @@ public:
         state->activitiesByType[type].its.emplace(act, i);
 
         if (type == actBuild) {
-            auto name = storePathToName(getS(fields, 0));
+            std::string name(storePathToName(getS(fields, 0)));
             if (hasSuffix(name, ".drv"))
                 name = name.substr(0, name.size() - 4);
             i->s = fmt("building " ANSI_BOLD "%s" ANSI_NORMAL, name);
@@ -467,11 +471,17 @@ public:
     }
 };
 
-void startProgressBar(bool printBuildLogs)
+Logger * makeProgressBar(bool printBuildLogs)
 {
-    logger = new ProgressBar(
+    return new ProgressBar(
         printBuildLogs,
-        isatty(STDERR_FILENO) && getEnv("TERM").value_or("dumb") != "dumb");
+        isatty(STDERR_FILENO) && getEnv("TERM").value_or("dumb") != "dumb"
+    );
+}
+
+void startProgressBar(bool printBuildLogs)
+{
+    logger = makeProgressBar(printBuildLogs);
 }
 
 void stopProgressBar()
diff --git a/src/nix/progress-bar.hh b/src/libmain/progress-bar.hh
similarity index 70%
rename from src/nix/progress-bar.hh
rename to src/libmain/progress-bar.hh
index 4d61175c24e4f7cfa384bcc1036aaf54c9ca5eec..7f0dafecf8ce3b6011ea032fea09620563fb015e 100644
--- a/src/nix/progress-bar.hh
+++ b/src/libmain/progress-bar.hh
@@ -4,6 +4,8 @@
 
 namespace nix {
 
+Logger * makeProgressBar(bool printBuildLogs = false);
+
 void startProgressBar(bool printBuildLogs = false);
 
 void stopProgressBar();
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index b8c01c01728f7e763b86744dff9e302301f67dd5..0f2c189a6dec3650293932969148d98eb7513872 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -2,6 +2,7 @@
 #include "shared.hh"
 #include "store-api.hh"
 #include "util.hh"
+#include "loggers.hh"
 
 #include <algorithm>
 #include <cctype>
@@ -169,7 +170,7 @@ LegacyArgs::LegacyArgs(const std::string & programName,
         .longName = "no-build-output",
         .shortName = 'Q',
         .description = "do not show build output",
-        .handler = {&settings.verboseBuild, false},
+        .handler = {[&]() {setLogFormat(LogFormat::raw); }},
     });
 
     addFlag({
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 04e8d2ebeb5ff61de8da48ce6e7cc4f50ff2d656..e5dc11e7de785fde5a056ad053ba9dbdec9a5980 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1660,7 +1660,7 @@ void DerivationGoal::buildDone()
                 worker.store.printStorePath(drvPath),
                 statusToString(status));
 
-            if (!settings.verboseBuild && !logTail.empty()) {
+            if (!logger->isVerbose() && !logTail.empty()) {
                 msg += (format("; last %d log lines:") % logTail.size()).str();
                 for (auto & line : logTail)
                     msg += "\n  " + line;
@@ -1709,11 +1709,7 @@ void DerivationGoal::buildDone()
                 }
 
                 void flushLine() {
-                    if (settings.verboseBuild) {
-                        printError("post-build-hook: " + currentLine);
-                    } else {
-                        act.result(resPostBuildLogLine, currentLine);
-                    }
+                    act.result(resPostBuildLogLine, currentLine);
                     currentLine.clear();
                 }
 
@@ -3743,7 +3739,7 @@ void DerivationGoal::registerOutputs()
                 worker.hashMismatch = true;
                 delayedException = std::make_exception_ptr(
                     BuildError("hash mismatch in fixed-output derivation '%s':\n  wanted: %s\n  got:    %s",
-                        worker.store.printStorePath(dest), h.to_string(SRI), h2.to_string(SRI)));
+                        worker.store.printStorePath(dest), h.to_string(SRI, true), h2.to_string(SRI, true)));
 
                 Path actualDest = worker.store.Store::toRealPath(dest);
 
@@ -4188,13 +4184,8 @@ void DerivationGoal::flushLine()
         ;
 
     else {
-        if (settings.verboseBuild &&
-            (settings.printRepeatedBuilds || curRound == 1))
-            printError(currentLogLine);
-        else {
-            logTail.push_back(currentLogLine);
-            if (logTail.size() > settings.logLines) logTail.pop_front();
-        }
+        logTail.push_back(currentLogLine);
+        if (logTail.size() > settings.logLines) logTail.pop_front();
 
         act->result(resBuildLogLine, currentLogLine);
     }
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc
index 4fb7ed5b2468c0a9eb83faec002b62979547b10c..2e29e3c7c527bbff88fec26e1eea0e237a8ab2c3 100644
--- a/src/libstore/daemon.cc
+++ b/src/libstore/daemon.cc
@@ -370,8 +370,10 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
         std::string s, baseName;
         FileIngestionMethod method;
         {
-            bool fixed, recursive;
+            bool fixed; uint8_t recursive;
             from >> baseName >> fixed /* obsolete */ >> recursive >> s;
+            if (recursive > (uint8_t) FileIngestionMethod::Recursive)
+                throw Error("unsupported FileIngestionMethod with value of %i; you may need to upgrade nix-daemon", recursive);
             method = FileIngestionMethod { recursive };
             /* Compatibility hack. */
             if (!fixed) {
diff --git a/src/libstore/export-import.cc b/src/libstore/export-import.cc
index f0d01a2404371916a2637c086cc28dfe77ab28b2..54471d4a3b14b529a9b53ffc6dace46f7840da11 100644
--- a/src/libstore/export-import.cc
+++ b/src/libstore/export-import.cc
@@ -57,7 +57,7 @@ void Store::exportPath(const StorePath & path, Sink & sink)
     Hash hash = hashAndWriteSink.currentHash();
     if (hash != info->narHash && info->narHash != Hash(info->narHash.type))
         throw Error("hash of path '%s' has changed from '%s' to '%s'!",
-            printStorePath(path), info->narHash.to_string(), hash.to_string());
+            printStorePath(path), info->narHash.to_string(Base32, true), hash.to_string(Base32, true));
 
     hashAndWriteSink
         << exportMagic
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index da95fd3ae91047b4555d624fec0802ed22addc39..2fbcafff87ba7e87818f5fd29e07b838dc992714 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -271,7 +271,7 @@ public:
         "listed in 'trusted-public-keys'."};
 
     Setting<StringSet> extraPlatforms{this,
-        std::string{SYSTEM} == "x86_64-linux" ? StringSet{"i686-linux"} : StringSet{},
+        std::string{SYSTEM} == "x86_64-linux" && !isWSL1() ? StringSet{"i686-linux"} : StringSet{},
         "extra-platforms",
         "Additional platforms that can be built on the local system. "
         "These may be supported natively (e.g. armv7 on some aarch64 CPUs "
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 53fb4ce683075d72b0cd642b5feb3cce0832b6fd..c5c82d4482266d750438f028621d6074f5e16b7d 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -584,7 +584,7 @@ uint64_t LocalStore::addValidPath(State & state,
 
     state.stmtRegisterValidPath.use()
         (printStorePath(info.path))
-        (info.narHash.to_string(Base16))
+        (info.narHash.to_string(Base16, true))
         (info.registrationTime == 0 ? time(0) : info.registrationTime)
         (info.deriver ? printStorePath(*info.deriver) : "", (bool) info.deriver)
         (info.narSize, info.narSize != 0)
@@ -684,7 +684,7 @@ void LocalStore::updatePathInfo(State & state, const ValidPathInfo & info)
 {
     state.stmtUpdatePathInfo.use()
         (info.narSize, info.narSize != 0)
-        (info.narHash.to_string(Base16))
+        (info.narHash.to_string(Base16, true))
         (info.ultimate ? 1 : 0, info.ultimate)
         (concatStringsSep(" ", info.sigs), !info.sigs.empty())
         (info.ca, !info.ca.empty())
@@ -1026,7 +1026,7 @@ void LocalStore::addToStore(const ValidPathInfo & info, Source & source,
 
             if (hashResult.first != info.narHash)
                 throw Error("hash mismatch importing path '%s';\n  wanted: %s\n  got:    %s",
-                    printStorePath(info.path), info.narHash.to_string(), hashResult.first.to_string());
+                    printStorePath(info.path), info.narHash.to_string(Base32, true), hashResult.first.to_string(Base32, true));
 
             if (hashResult.second != info.narSize)
                 throw Error("size mismatch importing path '%s';\n  wanted: %s\n  got:   %s",
@@ -1159,7 +1159,7 @@ StorePath LocalStore::addTextToStore(const string & name, const string & s,
             info.narHash = narHash;
             info.narSize = sink.s->size();
             info.references = cloneStorePathSet(references);
-            info.ca = "text:" + hash.to_string();
+            info.ca = "text:" + hash.to_string(Base32, true);
             registerValidPath(info);
         }
 
@@ -1282,7 +1282,7 @@ bool LocalStore::verifyStore(bool checkContents, RepairFlag repair)
                     logError({ 
                         .name = "Invalid hash - path modified",
                         .hint = hintfmt("path '%s' was modified! expected hash '%s', got '%s'",
-                        printStorePath(i), info->narHash.to_string(), current.first.to_string())
+                        printStorePath(i), info->narHash.to_string(Base32, true), current.first.to_string(Base32, true))
                     });
                     if (repair) repairPath(i); else errors = true;
                 } else {
diff --git a/src/libexpr/names.cc b/src/libstore/names.cc
similarity index 100%
rename from src/libexpr/names.cc
rename to src/libstore/names.cc
diff --git a/src/libexpr/names.hh b/src/libstore/names.hh
similarity index 100%
rename from src/libexpr/names.hh
rename to src/libstore/names.hh
diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc
index 442541330a2d0c815e1d5fd88fb0e18a3ec4d23a..e8cf1d17724e2489315fa00c8bc7e77dee2658a0 100644
--- a/src/libstore/nar-info-disk-cache.cc
+++ b/src/libstore/nar-info-disk-cache.cc
@@ -230,9 +230,9 @@ public:
                     (std::string(info->path.name()))
                     (narInfo ? narInfo->url : "", narInfo != 0)
                     (narInfo ? narInfo->compression : "", narInfo != 0)
-                    (narInfo && narInfo->fileHash ? narInfo->fileHash.to_string() : "", narInfo && narInfo->fileHash)
+                    (narInfo && narInfo->fileHash ? narInfo->fileHash.to_string(Base32, true) : "", narInfo && narInfo->fileHash)
                     (narInfo ? narInfo->fileSize : 0, narInfo != 0 && narInfo->fileSize)
-                    (info->narHash.to_string())
+                    (info->narHash.to_string(Base32, true))
                     (info->narSize)
                     (concatStringsSep(" ", info->shortRefs()))
                     (info->deriver ? std::string(info->deriver->to_string()) : "", (bool) info->deriver)
diff --git a/src/libstore/nar-info.cc b/src/libstore/nar-info.cc
index fbdcd778685c0e8e01ec73345ca39995b3c7f5dc..2322847232bb5fe7a511dd78667e3e6db5cb3fc6 100644
--- a/src/libstore/nar-info.cc
+++ b/src/libstore/nar-info.cc
@@ -87,10 +87,10 @@ std::string NarInfo::to_string(const Store & store) const
     assert(compression != "");
     res += "Compression: " + compression + "\n";
     assert(fileHash.type == htSHA256);
-    res += "FileHash: " + fileHash.to_string(Base32) + "\n";
+    res += "FileHash: " + fileHash.to_string(Base32, true) + "\n";
     res += "FileSize: " + std::to_string(fileSize) + "\n";
     assert(narHash.type == htSHA256);
-    res += "NarHash: " + narHash.to_string(Base32) + "\n";
+    res += "NarHash: " + narHash.to_string(Base32, true) + "\n";
     res += "NarSize: " + std::to_string(narSize) + "\n";
 
     res += "References: " + concatStringsSep(" ", shortRefs()) + "\n";
diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc
index cc0507be253c1c8662aae8dc9016fda588183405..d760d110c7ecd8967aa40db18161384a880ae4a3 100644
--- a/src/libstore/optimise-store.cc
+++ b/src/libstore/optimise-store.cc
@@ -153,7 +153,7 @@ void LocalStore::optimisePath_(Activity * act, OptimiseStats & stats,
        contents of the symlink (i.e. the result of readlink()), not
        the contents of the target (which may not even exist). */
     Hash hash = hashPath(htSHA256, path).first;
-    debug(format("'%1%' has hash '%2%'") % path % hash.to_string());
+    debug(format("'%1%' has hash '%2%'") % path % hash.to_string(Base32, true));
 
     /* Check if this is a known hash. */
     Path linkPath = linksDir + "/" + hash.to_string(Base32, false);
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 0e5e613f5989b3ae8f72644358b0629f11566b49..4197f8e1d3b105f4aae25eacd0256a36643b5394 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -142,7 +142,7 @@ StorePath Store::makeStorePath(const string & type,
     const Hash & hash, std::string_view name) const
 {
     /* e.g., "source:sha256:1abc...:/nix/store:foo.tar.gz" */
-    string s = type + ":" + hash.to_string(Base16) + ":" + storeDir + ":" + std::string(name);
+    string s = type + ":" + hash.to_string(Base16, true) + ":" + storeDir + ":" + std::string(name);
     auto h = compressHash(hashString(htSHA256, s), 20);
     return StorePath::make(h.hash, name);
 }
@@ -186,7 +186,7 @@ StorePath Store::makeFixedOutputPath(
             hashString(htSHA256,
                 "fixed:out:"
                 + (recursive == FileIngestionMethod::Recursive ? (string) "r:" : "")
-                + hash.to_string(Base16) + ":"),
+                + hash.to_string(Base16, true) + ":"),
             name);
     }
 }
@@ -461,7 +461,7 @@ void Store::pathInfoToJSON(JSONPlaceholder & jsonOut, const StorePathSet & store
             auto info = queryPathInfo(storePath);
 
             jsonPath
-                .attr("narHash", info->narHash.to_string(hashBase))
+                .attr("narHash", info->narHash.to_string(hashBase, true))
                 .attr("narSize", info->narSize);
 
             {
@@ -504,7 +504,7 @@ void Store::pathInfoToJSON(JSONPlaceholder & jsonOut, const StorePathSet & store
                     if (!narInfo->url.empty())
                         jsonPath.attr("url", narInfo->url);
                     if (narInfo->fileHash)
-                        jsonPath.attr("downloadHash", narInfo->fileHash.to_string());
+                        jsonPath.attr("downloadHash", narInfo->fileHash.to_string(Base32, true));
                     if (narInfo->fileSize)
                         jsonPath.attr("downloadSize", narInfo->fileSize);
                     if (showClosureSize)
@@ -760,7 +760,7 @@ std::string ValidPathInfo::fingerprint(const Store & store) const
             store.printStorePath(path));
     return
         "1;" + store.printStorePath(path) + ";"
-        + narHash.to_string(Base32) + ";"
+        + narHash.to_string(Base32, true) + ";"
         + std::to_string(narSize) + ";"
         + concatStringsSep(",", store.printStorePathSet(references));
 }
@@ -840,7 +840,7 @@ std::string makeFixedOutputCA(FileIngestionMethod recursive, const Hash & hash)
 {
     return "fixed:"
         + (recursive == FileIngestionMethod::Recursive ? (std::string) "r:" : "")
-        + hash.to_string();
+        + hash.to_string(Base32, true);
 }
 
 
diff --git a/src/libutil/args.cc b/src/libutil/args.cc
index 10d6e89bb7ca9608380040d8371ca2fa1b06a781..ce65801191aeb6aca7959f52ec8f627bab0c2f6b 100644
--- a/src/libutil/args.cc
+++ b/src/libutil/args.cc
@@ -217,10 +217,15 @@ MultiCommand::MultiCommand(const Commands & commands)
 {
     expectedArgs.push_back(ExpectedArg{"command", 1, true, [=](std::vector<std::string> ss) {
         assert(!command);
-        auto i = commands.find(ss[0]);
+        auto cmd = ss[0];
+        if (auto alias = get(deprecatedAliases, cmd)) {
+            warn("'%s' is a deprecated alias for '%s'", cmd, *alias);
+            cmd = *alias;
+        }
+        auto i = commands.find(cmd);
         if (i == commands.end())
-            throw UsageError("'%s' is not a recognised command", ss[0]);
-        command = {ss[0], i->second()};
+            throw UsageError("'%s' is not a recognised command", cmd);
+        command = {cmd, i->second()};
     }});
 
     categories[Command::catDefault] = "Available commands";
diff --git a/src/libutil/args.hh b/src/libutil/args.hh
index 1932e6a8ae473b85b4c17c0cc12fd90b2968077b..154d1e6aadbedecb799d1043371c4c2510e33f11 100644
--- a/src/libutil/args.hh
+++ b/src/libutil/args.hh
@@ -234,6 +234,8 @@ public:
 
     std::map<Command::Category, std::string> categories;
 
+    std::map<std::string, std::string> deprecatedAliases;
+
     // Selected command, if any.
     std::optional<std::pair<std::string, ref<Command>>> command;
 
diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh
index ea9fca3e74f2e0565d7a580928bf210be2609a21..4ff13f6b23a323d3f11d2158abf16c8b38ab2a56 100644
--- a/src/libutil/hash.hh
+++ b/src/libutil/hash.hh
@@ -79,7 +79,7 @@ struct Hash
     /* Return a string representation of the hash, in base-16, base-32
        or base-64. By default, this is prefixed by the hash type
        (e.g. "sha256:"). */
-    std::string to_string(Base base = Base32, bool includeType = true) const;
+    std::string to_string(Base base, bool includeType) const;
 
     std::string gitRev() const
     {
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index 41378b0db95eae328ed8c7bcb719eb9c07e2878f..108dc3bd1070e9ff0c2c22d125b88441925b69c5 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -18,7 +18,7 @@ void setCurActivity(const ActivityId activityId)
     curActivity = activityId;
 }
 
-Logger * logger = makeDefaultLogger();
+Logger * logger = makeSimpleLogger(true);
 
 void Logger::warn(const std::string & msg)
 {
@@ -35,13 +35,19 @@ class SimpleLogger : public Logger
 public:
 
     bool systemd, tty;
+    bool printBuildLogs;
 
-    SimpleLogger()
+    SimpleLogger(bool printBuildLogs)
+        : printBuildLogs(printBuildLogs)
     {
         systemd = getEnv("IN_SYSTEMD") == "1";
         tty = isatty(STDERR_FILENO);
     }
 
+    bool isVerbose() override {
+        return printBuildLogs;
+    }
+
     void log(Verbosity lvl, const FormatOrString & fs) override
     {
         if (lvl > verbosity) return;
@@ -78,6 +84,18 @@ public:
         if (lvl <= verbosity && !s.empty())
             log(lvl, s + "...");
     }
+
+    void result(ActivityId act, ResultType type, const Fields & fields) override
+    {
+        if (type == resBuildLogLine && printBuildLogs) {
+            auto lastLine = fields[0].s;
+            printError(lastLine);
+        }
+        else if (type == resPostBuildLogLine && printBuildLogs) {
+            auto lastLine = fields[0].s;
+            printError("post-build-hook: " + lastLine);
+        }
+    }
 };
 
 Verbosity verbosity = lvlInfo;
@@ -102,9 +120,9 @@ void writeToStderr(const string & s)
     }
 }
 
-Logger * makeDefaultLogger()
+Logger * makeSimpleLogger(bool printBuildLogs)
 {
-    return new SimpleLogger();
+    return new SimpleLogger(printBuildLogs);
 }
 
 std::atomic<uint64_t> nextId{(uint64_t) getpid() << 32};
@@ -121,6 +139,10 @@ struct JSONLogger : Logger {
 
     JSONLogger(Logger & prevLogger) : prevLogger(prevLogger) { }
 
+    bool isVerbose() override {
+        return true;
+    }
+
     void addFields(nlohmann::json & json, const Fields & fields)
     {
         if (fields.empty()) return;
diff --git a/src/libutil/logging.hh b/src/libutil/logging.hh
index eeb7233e917626e26faa32ad277cc9ff348a9500..b99b246c34c9c2969218d744b07a39c1e0a1015d 100644
--- a/src/libutil/logging.hh
+++ b/src/libutil/logging.hh
@@ -54,6 +54,11 @@ public:
 
     virtual ~Logger() { }
 
+    virtual void stop() { };
+
+    // Whether the logger prints the whole build log
+    virtual bool isVerbose() { return false; }
+
     virtual void log(Verbosity lvl, const FormatOrString & fs) = 0;
 
     void log(const FormatOrString & fs)
@@ -140,7 +145,7 @@ struct PushActivity
 
 extern Logger * logger;
 
-Logger * makeDefaultLogger();
+Logger * makeSimpleLogger(bool printBuildLogs = true);
 
 Logger * makeJSONLogger(Logger & prevLogger);
 
diff --git a/src/libutil/tests/hash.cc b/src/libutil/tests/hash.cc
index 7cb4398178a7a9df883a3e34408343ccfb3f666f..5334b046e5dd18f17c82ee993809b8d8f12c46d9 100644
--- a/src/libutil/tests/hash.cc
+++ b/src/libutil/tests/hash.cc
@@ -11,28 +11,28 @@ namespace nix {
         // values taken from: https://tools.ietf.org/html/rfc1321
         auto s1 = "";
         auto hash = hashString(HashType::htMD5, s1);
-        ASSERT_EQ(hash.to_string(Base::Base16), "md5:d41d8cd98f00b204e9800998ecf8427e");
+        ASSERT_EQ(hash.to_string(Base::Base16, true), "md5:d41d8cd98f00b204e9800998ecf8427e");
     }
 
     TEST(hashString, testKnownMD5Hashes2) {
         // values taken from: https://tools.ietf.org/html/rfc1321
         auto s2 = "abc";
         auto hash = hashString(HashType::htMD5, s2);
-        ASSERT_EQ(hash.to_string(Base::Base16), "md5:900150983cd24fb0d6963f7d28e17f72");
+        ASSERT_EQ(hash.to_string(Base::Base16, true), "md5:900150983cd24fb0d6963f7d28e17f72");
     }
 
     TEST(hashString, testKnownSHA1Hashes1) {
         // values taken from: https://tools.ietf.org/html/rfc3174
         auto s = "abc";
         auto hash = hashString(HashType::htSHA1, s);
-        ASSERT_EQ(hash.to_string(Base::Base16),"sha1:a9993e364706816aba3e25717850c26c9cd0d89d");
+        ASSERT_EQ(hash.to_string(Base::Base16, true),"sha1:a9993e364706816aba3e25717850c26c9cd0d89d");
     }
 
     TEST(hashString, testKnownSHA1Hashes2) {
         // values taken from: https://tools.ietf.org/html/rfc3174
         auto s = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
         auto hash = hashString(HashType::htSHA1, s);
-        ASSERT_EQ(hash.to_string(Base::Base16),"sha1:84983e441c3bd26ebaae4aa1f95129e5e54670f1");
+        ASSERT_EQ(hash.to_string(Base::Base16, true),"sha1:84983e441c3bd26ebaae4aa1f95129e5e54670f1");
     }
 
     TEST(hashString, testKnownSHA256Hashes1) {
@@ -40,7 +40,7 @@ namespace nix {
         auto s = "abc";
 
         auto hash = hashString(HashType::htSHA256, s);
-        ASSERT_EQ(hash.to_string(Base::Base16),
+        ASSERT_EQ(hash.to_string(Base::Base16, true),
                 "sha256:ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad");
     }
 
@@ -48,7 +48,7 @@ namespace nix {
         // values taken from: https://tools.ietf.org/html/rfc4634
         auto s = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
         auto hash = hashString(HashType::htSHA256, s);
-        ASSERT_EQ(hash.to_string(Base::Base16),
+        ASSERT_EQ(hash.to_string(Base::Base16, true),
                 "sha256:248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1");
     }
 
@@ -56,7 +56,7 @@ namespace nix {
         // values taken from: https://tools.ietf.org/html/rfc4634
         auto s = "abc";
         auto hash = hashString(HashType::htSHA512, s);
-        ASSERT_EQ(hash.to_string(Base::Base16),
+        ASSERT_EQ(hash.to_string(Base::Base16, true),
                 "sha512:ddaf35a193617abacc417349ae20413112e6fa4e89a9"
                 "7ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd"
                 "454d4423643ce80e2a9ac94fa54ca49f");
@@ -67,7 +67,7 @@ namespace nix {
         auto s = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
 
         auto hash = hashString(HashType::htSHA512, s);
-        ASSERT_EQ(hash.to_string(Base::Base16),
+        ASSERT_EQ(hash.to_string(Base::Base16, true),
                 "sha512:8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa1"
                 "7299aeadb6889018501d289e4900f7e4331b99dec4b5433a"
                 "c7d329eeb6dd26545e96e55b874be909");
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index dcf89ff6922844dce34e3119b3215d920b924bf3..0af2f843411540d625fcb07564a7b3a4e9618e41 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -972,7 +972,7 @@ pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
 {
     auto wrapper = [&]() {
         if (!options.allowVfork)
-            logger = makeDefaultLogger();
+            logger = makeSimpleLogger();
         try {
 #if __linux__
             if (options.dieWithParent && prctl(PR_SET_PDEATHSIG, SIGKILL) == -1)
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 30b647a6ac533c45a10c65c7b6e0504041ec7b11..1afb2bb565bd220bec2b110036d2c4f1a3ec42ab 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -460,8 +460,7 @@ string base64Encode(const string & s);
 string base64Decode(const string & s);
 
 
-/* Get a value for the specified key from an associate container, or a
-   default value if the key doesn't exist. */
+/* Get a value for the specified key from an associate container. */
 template <class T>
 std::optional<typename T::mapped_type> get(const T & map, const typename T::key_type & key)
 {
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc
index 03200d050ed7417b9334df10c2c78414e46f9bfa..591fff99980795a0820ebd744427565c0b9d03b7 100755
--- a/src/nix-build/nix-build.cc
+++ b/src/nix-build/nix-build.cc
@@ -477,6 +477,8 @@ static void _main(int argc, char * * argv)
 
         restoreSignals();
 
+        logger->stop();
+
         execvp(shell->c_str(), argPtrs.data());
 
         throw SysError("executing shell '%s'", *shell);
@@ -526,6 +528,8 @@ static void _main(int argc, char * * argv)
             if (auto store2 = store.dynamic_pointer_cast<LocalFSStore>())
                 store2->addPermRoot(store->parseStorePath(symlink.second), absPath(symlink.first), true);
 
+        logger->stop();
+
         for (auto & path : outPaths)
             std::cout << path << '\n';
     }
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index 8231a07a4382c20d723dbbe9e4987305390fe759..7ab5ba5000c7933347043955ad524a7488402a27 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -1457,6 +1457,8 @@ static int _main(int argc, char * * argv)
 
         globals.state->printStats();
 
+        logger->stop();
+
         return 0;
     }
 }
diff --git a/src/nix-prefetch-url/nix-prefetch-url.cc b/src/nix-prefetch-url/nix-prefetch-url.cc
index 58076ff14fc556946de98f9a7f4f9a300d498476..55b72bda6e67cd15dfb38fb95d11dc61004fc94d 100644
--- a/src/nix-prefetch-url/nix-prefetch-url.cc
+++ b/src/nix-prefetch-url/nix-prefetch-url.cc
@@ -8,7 +8,7 @@
 #include "attr-path.hh"
 #include "finally.hh"
 #include "../nix/legacy.hh"
-#include "../nix/progress-bar.hh"
+#include "progress-bar.hh"
 #include "tarfile.hh"
 
 #include <iostream>
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 5e42736fcdc8a2e65dcacee484f97d3430c768e7..dea53b52f8f8737669e8ce0e378516f3cd809652 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -373,7 +373,7 @@ static void opQuery(Strings opFlags, Strings opArgs)
                     auto info = store->queryPathInfo(j);
                     if (query == qHash) {
                         assert(info->narHash.type == htSHA256);
-                        cout << fmt("%s\n", info->narHash.to_string(Base32));
+                        cout << fmt("%s\n", info->narHash.to_string(Base32, true));
                     } else if (query == qSize)
                         cout << fmt("%d\n", info->narSize);
                 }
@@ -734,8 +734,8 @@ static void opVerifyPath(Strings opFlags, Strings opArgs)
                 .hint = hintfmt(
                     "path '%s' was modified! expected hash '%s', got '%s'",
                     store->printStorePath(path),
-                    info->narHash.to_string(),
-                    current.first.to_string())
+                    info->narHash.to_string(Base32, true),
+                    current.first.to_string(Base32, true))
             });
             status = 1;
         }
@@ -864,7 +864,7 @@ static void opServe(Strings opFlags, Strings opArgs)
                         out << info->narSize // downloadSize
                             << info->narSize;
                         if (GET_PROTOCOL_MINOR(clientVersion) >= 4)
-                            out << (info->narHash ? info->narHash.to_string() : "") << info->ca << info->sigs;
+                            out << (info->narHash ? info->narHash.to_string(Base32, true) : "") << info->ca << info->sigs;
                     } catch (InvalidPath &) {
                     }
                 }
@@ -1106,6 +1106,8 @@ static int _main(int argc, char * * argv)
 
         op(opFlags, opArgs);
 
+        logger->stop();
+
         return 0;
     }
 }
diff --git a/src/nix/dev-shell.cc b/src/nix/develop.cc
similarity index 96%
rename from src/nix/dev-shell.cc
rename to src/nix/develop.cc
index d300f6a230fb5f8e8f899b3cf5e9669c35d5fa47..3045d7dc3a596235f75ba1eb697825f7dfd646ad 100644
--- a/src/nix/dev-shell.cc
+++ b/src/nix/develop.cc
@@ -110,7 +110,7 @@ StorePath getDerivationEnvironment(ref<Store> store, const StorePath & drvPath)
 
     auto builder = baseNameOf(drv.builder);
     if (builder != "bash")
-        throw Error("'nix dev-shell' only works on derivations that use 'bash' as their builder");
+        throw Error("'nix develop' only works on derivations that use 'bash' as their builder");
 
     auto getEnvShPath = store->addTextToStore("get-env.sh", getEnvSh, {});
 
@@ -231,11 +231,11 @@ struct Common : InstallableCommand, MixProfile
     }
 };
 
-struct CmdDevShell : Common, MixEnvironment
+struct CmdDevelop : Common, MixEnvironment
 {
     std::vector<std::string> command;
 
-    CmdDevShell()
+    CmdDevelop()
     {
         addFlag({
             .longName = "command",
@@ -259,15 +259,15 @@ struct CmdDevShell : Common, MixEnvironment
         return {
             Example{
                 "To get the build environment of GNU hello:",
-                "nix dev-shell nixpkgs.hello"
+                "nix develop nixpkgs.hello"
             },
             Example{
                 "To store the build environment in a profile:",
-                "nix dev-shell --profile /tmp/my-shell nixpkgs.hello"
+                "nix develop --profile /tmp/my-shell nixpkgs.hello"
             },
             Example{
                 "To use a build environment previously recorded in a profile:",
-                "nix dev-shell /tmp/my-shell"
+                "nix develop /tmp/my-shell"
             },
         };
     }
@@ -341,4 +341,4 @@ struct CmdPrintDevEnv : Common
 };
 
 static auto r1 = registerCommand<CmdPrintDevEnv>("print-dev-env");
-static auto r2 = registerCommand<CmdDevShell>("dev-shell");
+static auto r2 = registerCommand<CmdDevelop>("develop");
diff --git a/src/nix/local.mk b/src/nix/local.mk
index 8c0eed19ef213c7110f5735aa32686c18818e4ec..43b7754e34b041cd082a53e6ffccc207126ccb76 100644
--- a/src/nix/local.mk
+++ b/src/nix/local.mk
@@ -28,4 +28,4 @@ $(eval $(call install-symlink, $(bindir)/nix, $(libexecdir)/nix/build-remote))
 
 src/nix-env/user-env.cc: src/nix-env/buildenv.nix.gen.hh
 
-src/nix/dev-shell.cc: src/nix/get-env.sh.gen.hh
+src/nix/develop.cc: src/nix/get-env.sh.gen.hh
diff --git a/src/nix/main.cc b/src/nix/main.cc
index ef301580ab901c09021ad5e02be778b7103dfc0e..203901168b93aff5784465a732c883aa127673d7 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -10,6 +10,7 @@
 #include "progress-bar.hh"
 #include "filetransfer.hh"
 #include "finally.hh"
+#include "loggers.hh"
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -90,7 +91,7 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
             .longName = "print-build-logs",
             .shortName = 'L',
             .description = "print full build logs on stderr",
-            .handler = {&printBuildLogs, true},
+            .handler = {[&]() {setLogFormat(LogFormat::barWithLogs); }},
         });
 
         addFlag({
@@ -110,6 +111,8 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
             .description = "consider all previously downloaded files out-of-date",
             .handler = {[&]() { refresh = true; }},
         });
+
+        deprecatedAliases.insert({"dev-shell", "develop"});
     }
 
     void printFlags(std::ostream & out) override
@@ -163,6 +166,10 @@ void mainWrapped(int argc, char * * argv)
     verbosity = lvlWarn;
     settings.verboseBuild = false;
 
+    setLogFormat("bar");
+
+    Finally f([] { logger->stop(); });
+
     NixArgs args;
 
     args.parseCmdline(argvToStrings(argc, argv));
@@ -176,10 +183,6 @@ void mainWrapped(int argc, char * * argv)
         && args.command->first != "upgrade-nix")
         settings.requireExperimentalFeature("nix-command");
 
-    Finally f([]() { stopProgressBar(); });
-
-    startProgressBar(args.printBuildLogs);
-
     if (args.useNet && !haveInternet()) {
         warn("you don't have Internet access; disabling some network-dependent features");
         args.useNet = false;
diff --git a/src/nix/verify.cc b/src/nix/verify.cc
index 8ecd9a8f3b7eac19dbcbbd9e483903e7ba17e6ae..246b4b480219001433aa0dc470abe97e6ca35320 100644
--- a/src/nix/verify.cc
+++ b/src/nix/verify.cc
@@ -104,11 +104,10 @@ struct CmdVerify : StorePathsCommand
                             .hint = hintfmt(
                                 "path '%s' was modified! expected hash '%s', got '%s'",
                                 store->printStorePath(info->path),
-                                info->narHash.to_string(),
-                                hash.first.to_string())
+                                info->narHash.to_string(Base32, true), 
+                                hash.first.to_string(Base32, true))
                         });
                     }
-
                 }
 
                 if (!noTrust) {
diff --git a/tests/remote-store.sh b/tests/remote-store.sh
index 77437658ead6065587345bd79d111b427069ddc6..4cc73465aeaca34c914cee1901c97d3ba9d624de 100644
--- a/tests/remote-store.sh
+++ b/tests/remote-store.sh
@@ -4,7 +4,7 @@ clearStore
 
 startDaemon
 
-storeCleared=1 $SHELL ./user-envs.sh
+storeCleared=1 NIX_REMOTE_=$NIX_REMOTE $SHELL ./user-envs.sh
 
 nix-store --dump-db > $TEST_ROOT/d1
 NIX_REMOTE= nix-store --dump-db > $TEST_ROOT/d2