about summary refs log tree commit diff
path: root/src/nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-14T16·20+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-14T16·20+0200
commit2e1493037b06eb97bf9e07693a974afadbf94386 (patch)
tree765972925cc5f3df36cdf6a7e5b7afd89a71ab3d /src/nix
parent6656ef7b5b798200cf8bf0c7534dbad1e964444d (diff)
nix path-info: Add some more examples
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/path-info.cc10
1 files changed, 9 insertions, 1 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])'"
             },
         };
     }