mkBinaryCache: fix FileHashes

This commit is contained in:
Ryan Trinkle
2024-12-21 20:00:10 -04:00
parent 4989a246d7
commit 173de32019
@@ -23,7 +23,7 @@ for item in closures:
with open(xzFile, "w") as f:
subprocess.run("nix-store --dump %s | xz -c" % item["path"], stdout=f, shell=True)
fileHash = subprocess.run(["nix-hash", "--base32", "--type", "sha256", item["path"]], capture_output=True).stdout.decode().strip()
fileHash = subprocess.run(["nix-hash", "--base32", "--type", "sha256", "--flat", xzFile], capture_output=True).stdout.decode().strip()
fileSize = os.path.getsize(xzFile)
# Rename the .nar.xz file to its own hash to match "nix copy" behavior