nix path-info: Add some more examples
This commit is contained in:
parent
6656ef7b5b
commit
2e1493037b
1 changed files with 9 additions and 1 deletions
|
@ -46,7 +46,15 @@ struct CmdPathInfo : StorePathsCommand
|
||||||
},
|
},
|
||||||
Example{
|
Example{
|
||||||
"To print the 10 most recently added paths (using --json and the jq(1) command):",
|
"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])'"
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue