diff --git a/pkgs/build-support/binary-cache/make-binary-cache.py b/pkgs/build-support/binary-cache/make-binary-cache.py index 589d005562b1f..c9a8601259062 100644 --- a/pkgs/build-support/binary-cache/make-binary-cache.py +++ b/pkgs/build-support/binary-cache/make-binary-cache.py @@ -23,7 +23,7 @@ def dropPrefix(path): 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