From adf8074abeed31453739dcecdd4f4a32c8c53eb6 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 23 Feb 2018 10:52:37 -0500 Subject: closureInfo: Report the total closure size. This can be useful for e.g. preallocating disk image sizes. --- pkgs/build-support/closure-info.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/build-support/closure-info.nix b/pkgs/build-support/closure-info.nix index 54b1fe59b66d..96c37bccf2e9 100644 --- a/pkgs/build-support/closure-info.nix +++ b/pkgs/build-support/closure-info.nix @@ -27,6 +27,7 @@ stdenv.mkDerivation { mkdir $out + jq -r ".closure | map(.narSize) | add" < .attrs.json > $out/total-nar-size jq -r '.closure | map([.path, .narHash, .narSize, "", (.references | length)] + .references) | add | map("\(.)\n") | add' < .attrs.json | head -n -1 > $out/registration jq -r .closure[].path < .attrs.json > $out/store-paths ''; -- cgit 1.4.1