Skip to content

Commit

Permalink
nix-prefetch-docker: provide hash in SRI format
Browse files Browse the repository at this point in the history
  • Loading branch information
nbraud authored and Mic92 committed Dec 9, 2024
1 parent d0e6b0e commit 5720f42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/build-helpers/images/dockertools.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ Writing manifest to image destination
{
imageName = "nixos/nix";
imageDigest = "sha256:498fa2d7f2b5cb3891a4edf20f3a8f8496e70865099ba72540494cd3e2942634";
sha256 = "1q6cf2pdrasa34zz0jw7pbs6lvv52rq2aibgxccbwcagwkg2qj1q";
hash = "sha256-OEgs3uRPMb4Y629FJXAWZW9q9LqHS/A/GUqr3K5wzOA=";
finalImageName = "nixos/nix";
finalImageTag = "latest";
}
Expand Down
6 changes: 3 additions & 3 deletions pkgs/build-support/docker/nix-prefetch-docker
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ else
fi

# Compute the hash.
imageHash=$(nix-hash --flat --type $hashType --base32 "$tmpFile")
imageHash=$(nix-hash --flat --type $hashType --sri "$tmpFile")

# Add the downloaded file to Nix store.
finalPath=$(nix-store --add-fixed "$hashType" "$tmpFile")
Expand All @@ -152,7 +152,7 @@ cat <<EOF
{
imageName = "$imageName";
imageDigest = "$imageDigest";
sha256 = "$imageHash";
hash = "$imageHash";
finalImageName = "$finalImageName";
finalImageTag = "$finalImageTag";
}
Expand All @@ -164,7 +164,7 @@ cat <<EOF
{
"imageName": "$imageName",
"imageDigest": "$imageDigest",
"sha256": "$imageHash",
"hash": "$imageHash",
"finalImageName": "$finalImageName",
"finalImageTag": "$finalImageTag"
}
Expand Down

0 comments on commit 5720f42

Please sign in to comment.