about summary refs log tree commit diff
path: root/src/nix
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/path-info.cc10
-rw-r--r--src/nix/sigs.cc4
-rw-r--r--src/nix/verify.cc10
3 files changed, 16 insertions, 8 deletions
diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc
index d8b6232d47ca..a9b33e1877dd 100644
--- a/src/nix/path-info.cc
+++ b/src/nix/path-info.cc
@@ -46,7 +46,15 @@ struct CmdPathInfo : StorePathsCommand
             },
             Example{
                 "To print the 10 most recently added paths (using --json and the jq(1) command):",
-                "nix path-info --all --json | jq -r 'sort_by(.registrationTime)[-11:-1][].path'"
+                "nix path-info --json --all | jq -r 'sort_by(.registrationTime)[-11:-1][].path'"
+            },
+            Example{
+                "To show the size of the entire Nix store:",
+                "nix path-info --json --all | jq 'map(.narSize) | add'"
+            },
+            Example{
+                "To show every path whose closure is bigger than 1 GB, sorted by closure size:",
+                "nix path-info --json --all -S | jq 'map(select(.closureSize > 1e9)) | sort_by(.closureSize) | map([.path, .closureSize])'"
             },
         };
     }
diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc
index 0c0d7b728f05..d8d8c0f53df0 100644
--- a/src/nix/sigs.cc
+++ b/src/nix/sigs.cc
@@ -84,7 +84,7 @@ struct CmdCopySigs : StorePathsCommand
 
         pool.process();
 
-        printMsg(lvlInfo, format("imported %d signatures") % added);
+        printInfo(format("imported %d signatures") % added);
     }
 };
 
@@ -132,7 +132,7 @@ struct CmdSignPaths : StorePathsCommand
             }
         }
 
-        printMsg(lvlInfo, format("added %d signatures") % added);
+        printInfo(format("added %d signatures") % added);
     }
 };
 
diff --git a/src/nix/verify.cc b/src/nix/verify.cc
index 519fcb6f898b..2f8d02fa060e 100644
--- a/src/nix/verify.cc
+++ b/src/nix/verify.cc
@@ -87,7 +87,7 @@ struct CmdVerify : StorePathsCommand
                     if (hash.first != info->narHash) {
                         logger->incProgress(corruptedLabel);
                         corrupted = 1;
-                        printMsg(lvlError,
+                        printError(
                             format("path ‘%s’ was modified! expected hash ‘%s’, got ‘%s’")
                             % info->path % printHash(info->narHash) % printHash(hash.first));
                     }
@@ -128,7 +128,7 @@ struct CmdVerify : StorePathsCommand
                                 doSigs(info2->sigs);
                             } catch (InvalidPath &) {
                             } catch (Error & e) {
-                                printMsg(lvlError, format(ANSI_RED "error:" ANSI_NORMAL " %s") % e.what());
+                                printError(format(ANSI_RED "error:" ANSI_NORMAL " %s") % e.what());
                             }
                         }
 
@@ -139,7 +139,7 @@ struct CmdVerify : StorePathsCommand
                     if (!good) {
                         logger->incProgress(untrustedLabel);
                         untrusted++;
-                        printMsg(lvlError, format("path ‘%s’ is untrusted") % info->path);
+                        printError(format("path ‘%s’ is untrusted") % info->path);
                     }
 
                 }
@@ -148,7 +148,7 @@ struct CmdVerify : StorePathsCommand
                 done++;
 
             } catch (Error & e) {
-                printMsg(lvlError, format(ANSI_RED "error:" ANSI_NORMAL " %s") % e.what());
+                printError(format(ANSI_RED "error:" ANSI_NORMAL " %s") % e.what());
                 logger->incProgress(failedLabel);
                 failed++;
             }
@@ -159,7 +159,7 @@ struct CmdVerify : StorePathsCommand
 
         pool.process();
 
-        printMsg(lvlInfo, format("%d paths checked, %d untrusted, %d corrupted, %d failed")
+        printInfo(format("%d paths checked, %d untrusted, %d corrupted, %d failed")
             % done % untrusted % corrupted % failed);
 
         throw Exit(