diff options
Diffstat (limited to 'corepkgs/nar.nix')
-rw-r--r-- | corepkgs/nar.nix | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/corepkgs/nar.nix b/corepkgs/nar.nix index 4747dc31def2..c5155dcc917c 100644 --- a/corepkgs/nar.nix +++ b/corepkgs/nar.nix @@ -8,14 +8,15 @@ let echo "packing ‘$storePath’..." mkdir $out - dst=$out/tmp.nar.bz2 + dst=$out/tmp.nar.xz set -o pipefail - nix-store --dump "$storePath" | ${bzip2} > $dst + nix-store --dump "$storePath" | ${xz} -9 > $dst - nix-hash --flat --type $hashAlgo --base32 $dst > $out/narbz2-hash + hash=$(nix-hash --flat --type $hashAlgo --base32 $dst) + echo -n $hash > $out/nar-compressed-hash - mv $out/tmp.nar.bz2 $out/$(cat $out/narbz2-hash).nar.bz2 + mv $dst $out/$hash.nar.xz ''; in |