treewide: add --extra-experimental-features nix-command to nix hash invocations
This commit is contained in:
parent
5c98cf024a
commit
df42f855db
@ -176,7 +176,7 @@ elsif (defined $expr) {
|
||||
|
||||
if ($hash =~ /^([a-z0-9]+)-([A-Za-z0-9+\/=]+)$/) {
|
||||
$algo = $1;
|
||||
$hash = `nix hash to-base16 $hash` or die;
|
||||
$hash = `nix --extra-experimental-features nix-command hash to-base16 $hash` or die;
|
||||
chomp $hash;
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ elsif (defined $expr) {
|
||||
|
||||
# Convert non-SRI base-64 to base-16.
|
||||
if ($hash =~ /^[A-Za-z0-9+\/=]+$/) {
|
||||
$hash = `nix hash to-base16 --type '$algo' $hash` or die;
|
||||
$hash = `nix --extra-experimental-features nix-command hash to-base16 --type '$algo' $hash` or die;
|
||||
chomp $hash;
|
||||
}
|
||||
|
||||
|
@ -8,14 +8,14 @@ reaper_ver=$(curl -Ls https://www.reaper.fm/download.php | grep -o 'Version [0-9
|
||||
function set_hash_for_linux() {
|
||||
local arch=$1
|
||||
pkg_hash=$(nix-prefetch-url https://www.reaper.fm/files/${reaper_ver%.*}.x/reaper${reaper_ver/./}_linux_$arch.tar.xz)
|
||||
pkg_hash=$(nix hash convert "sha256:$pkg_hash")
|
||||
pkg_hash=$(nix --extra-experimental-features nix-command hash convert "sha256:$pkg_hash")
|
||||
update-source-version reaper "${reaper_ver}" "$pkg_hash" --system=$arch-linux --ignore-same-version
|
||||
}
|
||||
|
||||
function set_hash_for_darwin() {
|
||||
local arch=$1
|
||||
pkg_hash=$(nix-prefetch-url https://www.reaper.fm/files/${reaper_ver%.*}.x/reaper${reaper_ver/./}_universal.dmg)
|
||||
pkg_hash=$(nix hash convert "sha256:$pkg_hash")
|
||||
pkg_hash=$(nix --extra-experimental-features nix-command hash convert "sha256:$pkg_hash")
|
||||
update-source-version reaper "${reaper_ver}" "$pkg_hash" --system=$arch-darwin --ignore-same-version
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ git clone --depth 1 --branch "v${version}" -c advice.detachedHead=false 'https:/
|
||||
git -C "$repo" checkout "tags/v${version}"
|
||||
|
||||
rm -rf "${repo}/.git"
|
||||
hashcheck=$(nix hash path "$repo")
|
||||
hashcheck=$(nix --extra-experimental-features nix-command hash path "$repo")
|
||||
|
||||
(cd "$nixpkgs" && update-source-version teos "$version" "$hashcheck" && update-source-version teos --ignore-same-version --source-key=cargoDeps)
|
||||
echo
|
||||
|
@ -17,7 +17,7 @@ echo "New version: $version"
|
||||
|
||||
url="https://github.com/Alexey-T/CudaText/archive/refs/tags/${version}.tar.gz"
|
||||
hash=$(nix-prefetch-url --quiet --unpack --type sha256 $url)
|
||||
sriHash=$(nix hash to-sri --type sha256 $hash)
|
||||
sriHash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $hash)
|
||||
|
||||
sed -i "s#version = \".*\"#version = \"$version\"#" default.nix
|
||||
sed -i "s#hash = \".*\"#hash = \"$sriHash\"#" default.nix
|
||||
@ -27,7 +27,7 @@ while IFS=$'\t' read repo owner rev; do
|
||||
if [ "$latest" != "$rev" ]; then
|
||||
url="https://github.com/${owner}/${repo}/archive/refs/tags/${latest}.tar.gz"
|
||||
hash=$(nix-prefetch-url --quiet --unpack --type sha256 $url)
|
||||
sriHash=$(nix hash to-sri --type sha256 $hash)
|
||||
sriHash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $hash)
|
||||
jq ".\"${repo}\".rev = \"${latest}\" | .\"${repo}\".hash = \"${sriHash}\"" deps.json | sponge deps.json
|
||||
fi
|
||||
done <<< $(jq -r 'to_entries[]|[.key,.value.owner,.value.rev]|@tsv' deps.json)
|
||||
|
@ -60,7 +60,7 @@ prefetchExtensionUnpacked() {
|
||||
declare unpackedStorePath
|
||||
unpackedStorePath="$(nix add-to-store -n "$unpackedStoreName" "$tmpDir")"
|
||||
declare unpackedSha256
|
||||
unpackedSha256="$(nix hash-path --base32 --type sha256 "$unpackedStorePath")"
|
||||
unpackedSha256="$(nix --extra-experimental-features nix-command hash path --base32 --type sha256 "$unpackedStorePath")"
|
||||
1>&2 echo "unpackedStorePath='$unpackedStorePath'"
|
||||
1>&2 echo "unpackedSha256='$unpackedSha256'"
|
||||
|
||||
|
@ -58,7 +58,7 @@ make_trapped_tmpdir
|
||||
unzip -q -d "$tmpDir" "$cpptoolsZipStorePath"
|
||||
|
||||
cpptoolsStorePath="$(nix add-to-store -n "$extStoreName" "$tmpDir")"
|
||||
cpptoolsSha256="$(nix hash-path --base32 --type sha512 "$cpptoolsStorePath")"
|
||||
cpptoolsSha256="$(nix --extra-experimental-features nix-command hash path --base32 --type sha512 "$cpptoolsStorePath")"
|
||||
echo "cpptoolsStorePath='$cpptoolsStorePath'"
|
||||
echo "cpptoolsSha256='$cpptoolsSha256'"
|
||||
|
||||
|
@ -18,7 +18,7 @@ update-source-version vscode $latestVersion
|
||||
|
||||
systems=$(nix eval --json -f . vscode.meta.platforms | jq --raw-output '.[]')
|
||||
for system in $systems; do
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix eval --raw -f . vscode.src.url --system "$system")))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix eval --raw -f . vscode.src.url --system "$system")))
|
||||
update-source-version vscode $latestVersion $hash --system=$system --ignore-same-version --ignore-same-hash
|
||||
done
|
||||
|
||||
|
@ -21,6 +21,6 @@ for i in \
|
||||
"aarch64-darwin darwin-arm64 zip" \
|
||||
"x86_64-darwin darwin-x64 zip"; do
|
||||
set -- $i
|
||||
hash=$(nix hash convert --hash-algo sha256 --to sri $(nix-prefetch-url "https://github.com/VSCodium/vscodium/releases/download/$latestVersion/VSCodium-$2-$latestVersion.$3"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $(nix-prefetch-url "https://github.com/VSCodium/vscodium/releases/download/$latestVersion/VSCodium-$2-$latestVersion.$3"))
|
||||
update-source-version vscodium $latestVersion $hash --system=$1 --ignore-same-version
|
||||
done
|
||||
|
@ -30,6 +30,6 @@ fi
|
||||
|
||||
for lang in $langCodes; do
|
||||
url=https://github.com/tesseract-ocr/tessdata/raw/$tessdataRev/$lang.traineddata
|
||||
hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url $url 2>/dev/null))
|
||||
hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url $url 2>/dev/null))
|
||||
echo "$lang = \"$hash\";"
|
||||
done
|
||||
|
@ -46,7 +46,7 @@ writeScript "update-librewolf" ''
|
||||
repoUrl=https://codeberg.org/librewolf/source.git
|
||||
nix-prefetch-git $repoUrl --quiet --rev $latestTag --fetch-submodules > $prefetchOut
|
||||
srcDir=$(jq -r .path < $prefetchOut)
|
||||
srcHash=$(nix hash convert --to sri --hash-algo sha256 $(jq -r .sha256 < $prefetchOut))
|
||||
srcHash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(jq -r .sha256 < $prefetchOut))
|
||||
|
||||
ffVersion=$(<$srcDir/version)
|
||||
lwRelease=$(<$srcDir/release)
|
||||
@ -68,7 +68,7 @@ writeScript "update-librewolf" ''
|
||||
curl --silent --show-error -o "$HOME"/shasums.asc "$mozillaUrl$ffVersion/SHA512SUMS.asc"
|
||||
gpgv --keyring="$GNUPGHOME"/pubring.kbx "$HOME"/shasums.asc "$HOME"/shasums
|
||||
|
||||
ffHash=$(nix hash convert --to sri --hash-algo sha512 $(grep '\.source\.tar\.xz$' "$HOME"/shasums | grep '^[^ ]*' -o))
|
||||
ffHash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha512 $(grep '\.source\.tar\.xz$' "$HOME"/shasums | grep '^[^ ]*' -o))
|
||||
echo "ffHash=$ffHash"
|
||||
|
||||
jq ".source.rev = \"$latestTag\"" $srcJson | sponge $srcJson
|
||||
|
@ -16,7 +16,7 @@ sed -i "s|$PREV_VERSION|$NEXT_VERSION|" "$FILE"
|
||||
|
||||
# update hash
|
||||
PREV_HASH=$(nix eval --raw -f $NIXPKGS_ROOT/default.nix $ATTR.src.outputHash)
|
||||
NEXT_HASH=$(nix hash to-sri --type sha256 $(nix-prefetch-url --unpack --type sha256 $(nix eval --raw -f $NIXPKGS_ROOT/default.nix $ATTR.src.url)))
|
||||
NEXT_HASH=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --unpack --type sha256 $(nix eval --raw -f $NIXPKGS_ROOT/default.nix $ATTR.src.url)))
|
||||
sed -i "s|$PREV_HASH|$NEXT_HASH|" "$FILE"
|
||||
|
||||
# update vendor hash
|
||||
|
@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
|
||||
fi
|
||||
|
||||
DOWNLOAD_URL="${mavenGroupIdUrl}/atlassian-plugin-sdk/${version}/atlassian-plugin-sdk-$NEW_VERSION.tar.gz"
|
||||
NIX_HASH=$(nix hash to-sri sha256:$(nix-prefetch-url $DOWNLOAD_URL))
|
||||
NIX_HASH=$(nix --extra-experimental-features nix-command hash to-sri sha256:$(nix-prefetch-url $DOWNLOAD_URL))
|
||||
|
||||
update-source-version "atlassian-plugin-sdk" "$NEW_VERSION" "$NIX_HASH" "$DOWNLOAD_URL"
|
||||
'';
|
||||
|
@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
src = requireFile {
|
||||
name = "Balatro-${finalAttrs.version}.exe";
|
||||
url = "https://store.steampowered.com/app/2379780/Balatro/";
|
||||
# Use `nix hash file --sri --type sha256` to get the correct hash
|
||||
# Use `nix --extra-experimental-features nix-command hash file --sri --type sha256` to get the correct hash
|
||||
hash = "sha256-DXX+FkrM8zEnNNSzesmHiN0V8Ljk+buLf5DE5Z3pP0c=";
|
||||
};
|
||||
|
||||
|
@ -16,5 +16,5 @@ fi
|
||||
|
||||
nix-update beekeeper-studio --version "$latestVersion" || true
|
||||
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url "$(nix eval -f . --raw beekeeper-studio.src.url --system aarch64-linux)"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url "$(nix eval -f . --raw beekeeper-studio.src.url --system aarch64-linux)"))
|
||||
update-source-version beekeeper-studio $latestVersion $hash --system=aarch64-linux --ignore-same-version
|
||||
|
@ -14,8 +14,8 @@ amd64_hash=$(nix-prefetch-url $amd64_url)
|
||||
arm64_hash=$(nix-prefetch-url $arm64_url)
|
||||
|
||||
# use friendlier hashes
|
||||
amd64_hash=$(nix hash convert --to sri --hash-algo sha256 "$amd64_hash")
|
||||
arm64_hash=$(nix hash convert --to sri --hash-algo sha256 "$arm64_hash")
|
||||
amd64_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$amd64_hash")
|
||||
arm64_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$arm64_hash")
|
||||
|
||||
cat >sources.nix <<EOF
|
||||
# Generated by ./update.sh - do not update manually!
|
||||
|
@ -18,7 +18,7 @@ fi
|
||||
|
||||
sed -i "s/\(tag = \"v\${version}+\)[0-9]\+/\1${RunNumber}/" "$ROOT/package.nix"
|
||||
|
||||
hash=$(nix hash convert --hash-algo sha256 --to sri $(nix-prefetch-url --unpack "https://github.com/HemantKArya/BloomeeTunes/archive/refs/tags/${latestTag}.tar.gz"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $(nix-prefetch-url --unpack "https://github.com/HemantKArya/BloomeeTunes/archive/refs/tags/${latestTag}.tar.gz"))
|
||||
update-source-version bloomeetunes $latestVersion $hash
|
||||
|
||||
curl https://raw.githubusercontent.com/HemantKArya/BloomeeTunes/${latestTag}/pubspec.lock | yq . >$ROOT/pubspec.lock.json
|
||||
|
@ -15,7 +15,7 @@ function calc_hash () {
|
||||
local arch=$2
|
||||
url="https://releases.hashicorp.com/boundary/${version}/boundary_${version}_${arch}.zip"
|
||||
zip_hash=$(nix-prefetch-url --unpack $url)
|
||||
nix hash to-sri --type sha256 "$zip_hash"
|
||||
nix --extra-experimental-features nix-command hash to-sri --type sha256 "$zip_hash"
|
||||
}
|
||||
|
||||
replace_sha() {
|
||||
|
@ -27,7 +27,7 @@ HFILE=pkgs/by-name/bu/buck2/hashes.json
|
||||
rm -f "$HFILE" && touch "$HFILE"
|
||||
|
||||
PRELUDE_SHA256HASH="$(nix-prefetch-url --type sha256 "$PRELUDE_DL_URL")"
|
||||
PRELUDE_SRIHASH="$(nix hash to-sri --type sha256 "$PRELUDE_SHA256HASH")"
|
||||
PRELUDE_SRIHASH="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$PRELUDE_SHA256HASH")"
|
||||
|
||||
printf "{ \"_comment\": \"@generated by pkgs/by-name/bu/buck2/update.sh\"\n" >> "$HFILE"
|
||||
printf ", \"_prelude\": \"$PRELUDE_SRIHASH\"\n" >> "$HFILE"
|
||||
@ -35,12 +35,12 @@ printf ", \"_prelude\": \"$PRELUDE_SRIHASH\"\n" >> "$HFILE"
|
||||
for arch in "${ARCHS[@]}"; do
|
||||
IFS=: read -r arch_name arch_target <<< "$arch"
|
||||
sha256hash="$(nix-prefetch-url --type sha256 "https://github.com/facebook/buck2/releases/download/${VERSION}/buck2-${arch_target}.zst")"
|
||||
srihash="$(nix hash to-sri --type sha256 "$sha256hash")"
|
||||
srihash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$sha256hash")"
|
||||
echo ", \"buck2-$arch_name\": \"$srihash\"" >> "$HFILE"
|
||||
|
||||
IFS=: read -r arch_name arch_target <<< "$arch"
|
||||
sha256hash="$(nix-prefetch-url --type sha256 "https://github.com/facebook/buck2/releases/download/${VERSION}/rust-project-${arch_target}.zst")"
|
||||
srihash="$(nix hash to-sri --type sha256 "$sha256hash")"
|
||||
srihash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$sha256hash")"
|
||||
echo ", \"rust-project-$arch_name\": \"$srihash\"" >> "$HFILE"
|
||||
done
|
||||
echo "}" >> "$HFILE"
|
||||
|
@ -18,7 +18,7 @@ let
|
||||
.${system};
|
||||
|
||||
# Get hash in sri format
|
||||
# nix-prefetch-url <url> | xargs nix hash convert --hash-algo sha256
|
||||
# nix-prefetch-url <url> | xargs nix --extra-experimental-features nix-command hash convert --hash-algo sha256
|
||||
hash =
|
||||
{
|
||||
x86_64-linux = "sha256-DK5+VT4+OCcJ4Bbv6GGs6R332GMsD1gNEmcz0iaJb1c=";
|
||||
|
@ -8,7 +8,7 @@ XML_DATA=$(curl -s $XML_URL)
|
||||
LATEST_VERSION=$(echo "$XML_DATA" | xmllint --xpath '/rss/channel/item[1]/*[local-name()="shortVersionString"]/text()' -)
|
||||
DOWNLOAD_URL=$(echo "$XML_DATA" | xmllint --xpath 'string(//item[1]/enclosure/@url)' -)
|
||||
|
||||
HASH=$(nix-prefetch-url $DOWNLOAD_URL | xargs nix hash convert --hash-algo sha256)
|
||||
HASH=$(nix-prefetch-url $DOWNLOAD_URL | xargs nix --extra-experimental-features nix-command hash convert --hash-algo sha256)
|
||||
|
||||
SOURCE_NIX="$(dirname ${BASH_SOURCE[0]})/source.nix"
|
||||
|
||||
|
@ -59,7 +59,7 @@ buildGraalvmNativeImage (finalAttrs: {
|
||||
old_jar_hash="$(nix-instantiate --strict --json --eval -A clojure-lsp.jar.drvAttrs.outputHash | jq -r .)"
|
||||
|
||||
curl -o clojure-lsp-standalone.jar -sL "https://github.com/clojure-lsp/clojure-lsp/releases/download/$latest_version/clojure-lsp-standalone.jar"
|
||||
new_jar_hash="$(nix-hash --flat --type sha256 clojure-lsp-standalone.jar | xargs -n1 nix hash convert --hash-algo sha256)"
|
||||
new_jar_hash="$(nix-hash --flat --type sha256 clojure-lsp-standalone.jar | xargs -n1 nix --extra-experimental-features nix-command hash convert --hash-algo sha256)"
|
||||
|
||||
rm -f clojure-lsp-standalone.jar
|
||||
|
||||
|
@ -32,7 +32,7 @@ update_version_and_hashes() {
|
||||
|
||||
# Fetch the new hash using nix-prefetch-url
|
||||
local NEW_HASH=$(nix-prefetch-url --type sha256 $URL)
|
||||
local SRI_HASH=$(nix hash to-sri --type sha256 $NEW_HASH)
|
||||
local SRI_HASH=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $NEW_HASH)
|
||||
|
||||
# Update the Nix file with the new hash, using '#' as delimiter and preserving indentation
|
||||
sed -i "/${channel} = {/,/};/{
|
||||
|
@ -26,6 +26,6 @@ for i in \
|
||||
"x86_64-darwin darwin_amd64" \
|
||||
"aarch64-darwin darwin_arm64"; do
|
||||
set -- $i
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url "https://s3-us-west-2.amazonaws.com/confluent.cloud/confluent-cli/archives/$latestVersion/confluent_${latestVersion}_$2.tar.gz"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url "https://s3-us-west-2.amazonaws.com/confluent.cloud/confluent-cli/archives/$latestVersion/confluent_${latestVersion}_$2.tar.gz"))
|
||||
update-source-version confluent-cli $latestVersion $hash --system=$1 --ignore-same-version
|
||||
done
|
||||
|
@ -26,7 +26,7 @@ CRC_COMMIT=$(curl --silent ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
|
||||
jq -r "map(select(.name == \"${LATEST_TAG_NAME}\")) | .[0] | .commit.sha")
|
||||
|
||||
CRC_GIT_PREFETCH=$(nix-prefetch-url --unpack https://github.com/crc-org/crc/archive/${CRC_COMMIT}.tar.gz)
|
||||
CRC_GIT_HASH=$(nix hash convert --to sri --hash-algo sha256 ${CRC_GIT_PREFETCH})
|
||||
CRC_GIT_HASH=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 ${CRC_GIT_PREFETCH})
|
||||
|
||||
FILE_MAKEFILE=${WORKDIR}/Makefile
|
||||
curl --silent https://raw.githubusercontent.com/crc-org/crc/${CRC_COMMIT}/Makefile >$FILE_MAKEFILE
|
||||
|
@ -17,6 +17,6 @@ for system in \
|
||||
aarch64-linux \
|
||||
x86_64-darwin \
|
||||
aarch64-darwin; do
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; dbgate.src.url" --system "$system" | tr -d '"')))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; dbgate.src.url" --system "$system" | tr -d '"')))
|
||||
update-source-version dbgate $latestVersion $hash --system=$system --ignore-same-version
|
||||
done
|
||||
|
@ -21,7 +21,7 @@ if [ "$OLD_VERSION" = "$VERSION" ]; then
|
||||
fi
|
||||
|
||||
SHA256="$(nix-prefetch-url --quiet --unpack https://github.com/dependabot/cli/archive/refs/tags/v${VERSION}.tar.gz)"
|
||||
HASH="$(nix hash convert --hash-algo sha256 --to sri "$SHA256")"
|
||||
HASH="$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri "$SHA256")"
|
||||
|
||||
nix-prefetch-docker --json --quiet --final-image-name dependabot-update-job-proxy --final-image-tag "nixpkgs-dependabot-cli-$VERSION" ghcr.io/github/dependabot-update-job-proxy/dependabot-update-job-proxy latest > "$temp_dir/dependabot-update-job-proxy.json"
|
||||
|
||||
|
@ -29,7 +29,7 @@ cd $TMPDIR
|
||||
|
||||
curl https://raw.githubusercontent.com/the-draupnir-project/Draupnir/v$latestVersion/yarn.lock -o yarn.lock
|
||||
TMP_PREFETCH_HASH=`prefetch-yarn-deps yarn.lock`
|
||||
NEW_YARN_OFFLINE_HASH=`nix hash to-sri --type sha256 $TMP_PREFETCH_HASH`
|
||||
NEW_YARN_OFFLINE_HASH=`nix --extra-experimental-features nix-command hash to-sri --type sha256 $TMP_PREFETCH_HASH`
|
||||
|
||||
cd -
|
||||
echo "New yarn offline hash: $NEW_YARN_OFFLINE_HASH"
|
||||
|
@ -18,7 +18,7 @@ let
|
||||
"aarch64-linux" = "linux-arm64";
|
||||
};
|
||||
_platform = _supportedPlatforms."${stdenv.hostPlatform.system}";
|
||||
# nix hash convert --to sri "sha256:`nix-prefetch-url --unpack https://updates.duplicati.com/stable/duplicati-2.1.0.5_stable_2025-03-04-linux-arm64-cli.zip`"
|
||||
# nix --extra-experimental-features nix-command hash convert --to sri "sha256:`nix-prefetch-url --unpack https://updates.duplicati.com/stable/duplicati-2.1.0.5_stable_2025-03-04-linux-arm64-cli.zip`"
|
||||
_fileHashForSystem = {
|
||||
"armv7l-linux" = "sha256-FQQ07M0rwvxNkHPW6iK5WBTKgFrZ4LOP4vgINfmtq4k=";
|
||||
"x86_64-linux" = "sha256-1QspF/A3hOtqd8bVbSqClJIHUN9gBrd18J5qvZJLkQE=";
|
||||
|
@ -74,7 +74,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
fi
|
||||
|
||||
DOWNLOAD_URL="https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_$NEW_VERSION_DATE.tar.gz"
|
||||
NIX_HASH=$(nix hash to-sri sha256:$(nix-prefetch-url $DOWNLOAD_URL))
|
||||
NIX_HASH=$(nix --extra-experimental-features nix-command hash to-sri sha256:$(nix-prefetch-url $DOWNLOAD_URL))
|
||||
|
||||
update-source-version "dynamodb-local" "$NEW_VERSION" "$NIX_HASH" "$DOWNLOAD_URL"
|
||||
'';
|
||||
|
@ -32,7 +32,7 @@ echo "Verifying commit"
|
||||
git -C $repo verify-tag v${version}
|
||||
|
||||
rm -rf $repo/.git
|
||||
hash=$(nix hash path $repo)
|
||||
hash=$(nix --extra-experimental-features nix-command hash path $repo)
|
||||
|
||||
(cd "$nixpkgs" && update-source-version electrs "$version" "$hash" && update-source-version electrs --ignore-same-version --source-key=cargoDeps)
|
||||
echo
|
||||
|
@ -14,7 +14,7 @@ fetch_arch() {
|
||||
VER="$1"
|
||||
ARCH="$2"
|
||||
URL="https://github.com/envoyproxy/envoy/releases/download/v${VER}/envoy-${VER}-linux-${ARCH}"
|
||||
nix hash convert --to sri --hash-algo sha256 "$(nix-prefetch-url --type sha256 "$URL")"
|
||||
nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$(nix-prefetch-url --type sha256 "$URL")"
|
||||
}
|
||||
|
||||
replace_hash() {
|
||||
|
@ -217,7 +217,7 @@ stdenv.mkDerivation {
|
||||
update_link=$(echo $package_info | jq -r '.data.download_link' | sed 's/lf[0-9]*-ug-sign.feishucdn.com/sf3-cn.feishucdn.com\/obj/;s/?.*$//')
|
||||
new_version=$(echo $package_info | jq -r '.data.version_number' | sed -n 's/.*@V//p')
|
||||
sha256_hash=$(nix-prefetch-url $update_link)
|
||||
sri_hash=$(nix hash to-sri --type sha256 $sha256_hash)
|
||||
sri_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $sha256_hash)
|
||||
update-source-version feishu $new_version $sri_hash $update_link --system=$platform --ignore-same-version --source-key="sources.$platform"
|
||||
done
|
||||
'';
|
||||
|
@ -14,7 +14,7 @@ new_nnue_big_file="$(
|
||||
grep --perl-regexp --only-matching 'EvalFileDefaultNameBig "\Knn-(\w+).nnue'
|
||||
)"
|
||||
new_nnue_big_hash="$(
|
||||
nix hash to-sri --type sha256 "$(
|
||||
nix --extra-experimental-features nix-command hash to-sri --type sha256 "$(
|
||||
nix-prefetch-url --type sha256 "https://tests.stockfishchess.org/api/nn/${new_nnue_big_file}"
|
||||
)"
|
||||
)"
|
||||
@ -23,7 +23,7 @@ new_nnue_small_file="$(
|
||||
grep --perl-regexp --only-matching 'EvalFileDefaultNameSmall "\Knn-(\w+).nnue'
|
||||
)"
|
||||
new_nnue_small_hash="$(
|
||||
nix hash to-sri --type sha256 "$(
|
||||
nix --extra-experimental-features nix-command hash to-sri --type sha256 "$(
|
||||
nix-prefetch-url --type sha256 "https://tests.stockfishchess.org/api/nn/${new_nnue_small_file}"
|
||||
)"
|
||||
)"
|
||||
|
@ -12,9 +12,9 @@ LATEST_VERSION=$(echo "${LATEST_TAG}" | sed 's/^v//')
|
||||
|
||||
if [ ! "$OLD_VERSION" = "$LATEST_VERSION" ]; then
|
||||
SRC_SHA256=$(nix-prefetch-url --quiet --unpack "https://github.com/fluxcd/flux2/archive/refs/tags/${LATEST_TAG}.tar.gz")
|
||||
SRC_HASH=$(nix hash convert --hash-algo sha256 --to sri "$SRC_SHA256")
|
||||
SRC_HASH=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri "$SRC_SHA256")
|
||||
MANIFESTS_SHA256=$(nix-prefetch-url --quiet --unpack "https://github.com/fluxcd/flux2/releases/download/${LATEST_TAG}/manifests.tar.gz")
|
||||
MANIFESTS_HASH=$(nix hash convert --hash-algo sha256 --to sri "$MANIFESTS_SHA256")
|
||||
MANIFESTS_HASH=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri "$MANIFESTS_SHA256")
|
||||
|
||||
setKV () {
|
||||
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" "${FLUXCD_PATH}/package.nix"
|
||||
@ -27,7 +27,7 @@ if [ ! "$OLD_VERSION" = "$LATEST_VERSION" ]; then
|
||||
|
||||
set +e
|
||||
VENDOR_SHA256=$(nix-build --no-out-link -A fluxcd "$NIXPKGS_PATH" 2>&1 >/dev/null | grep "got:" | cut -d':' -f2 | sed 's| ||g')
|
||||
VENDOR_HASH=$(nix hash convert --hash-algo sha256 --to sri "$VENDOR_SHA256")
|
||||
VENDOR_HASH=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri "$VENDOR_SHA256")
|
||||
set -e
|
||||
|
||||
if [ -n "${VENDOR_HASH:-}" ]; then
|
||||
|
@ -91,7 +91,7 @@ stdenvNoCC.mkDerivation (
|
||||
|
||||
echo "Fetching hash for $system"
|
||||
hash=$(nix-prefetch-url --type sha256 $url --unpack)
|
||||
sriHash="$(nix hash to-sri --type sha256 $hash)"
|
||||
sriHash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $hash)"
|
||||
|
||||
yq -iPoj ". + { \"$system\": { \"url\": \"$url\", \"hash\": \"$sriHash\" } }" "$tempfile"
|
||||
}
|
||||
@ -101,7 +101,7 @@ stdenvNoCC.mkDerivation (
|
||||
|
||||
echo "Fetching hash"
|
||||
hash=$(nix-prefetch-url --type sha256 $url --unpack)
|
||||
sriHash="$(nix hash to-sri --type sha256 $hash)"
|
||||
sriHash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $hash)"
|
||||
|
||||
yq -iPoj ". + { \"url\": \"$url\", \"hash\": \"$sriHash\" }" "$tempfile"
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ update_linux() {
|
||||
|
||||
local download_url="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${version}-1_amd64.deb"
|
||||
new_hash="$(nix-prefetch-url "$download_url" 2>/dev/null)"
|
||||
new_sri_hash="$(nix hash to-sri --type sha256 "$new_hash")"
|
||||
new_sri_hash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$new_hash")"
|
||||
|
||||
sed -i "/^ linux = stdenvNoCC.mkDerivation/,/^ });/s/version = \".*\"/version = \"$version\"/" "$DEFAULT_NIX"
|
||||
sed -i "/^ linux = stdenvNoCC.mkDerivation/,/^ });/s|hash = \".*\"|hash = \"$new_sri_hash\"|" "$DEFAULT_NIX"
|
||||
@ -87,8 +87,8 @@ update_darwin() {
|
||||
manifest_version="$(echo "$response" | xmllint --xpath "string(//manifest/@version)" -)"
|
||||
|
||||
local download_url="$url$pkg"
|
||||
new_hash="$(nix hash to-sri --type sha256 "$(nix-prefetch-url "$download_url" 2>/dev/null)")"
|
||||
new_sri_hash="$(nix hash to-sri --type sha256 "$new_hash")"
|
||||
new_hash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$(nix-prefetch-url "$download_url" 2>/dev/null)")"
|
||||
new_sri_hash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$new_hash")"
|
||||
|
||||
sed -i "/^ darwin = stdenvNoCC.mkDerivation/,/^ });/s/version = \".*\"/version = \"$manifest_version\"/" "$DEFAULT_NIX"
|
||||
sed -i "/^ darwin = stdenvNoCC.mkDerivation/,/^ });/s|hash = \".*\"|hash = \"$new_sri_hash\"|" "$DEFAULT_NIX"
|
||||
|
@ -19,6 +19,6 @@ for system in \
|
||||
aarch64-linux \
|
||||
x86_64-darwin \
|
||||
aarch64-darwin; do
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; hamrs-pro.src.url" --system "$system" | tr -d '"')))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; hamrs-pro.src.url" --system "$system" | tr -d '"')))
|
||||
update-source-version hamrs-pro $latestVersion $hash --system=$system --ignore-same-version
|
||||
done
|
||||
|
@ -154,7 +154,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
if [[ "x$UPDATE_NIX_OLD_VERSION" != "x$version" ]]; then
|
||||
|
||||
revision=$(jq -r .revision <<<"$data")
|
||||
hash=$(nix hash to-sri "sha512:$(jq -r .download_sha512 <<<"$data")")
|
||||
hash=$(nix --extra-experimental-features nix-command hash to-sri "sha512:$(jq -r .download_sha512 <<<"$data")")
|
||||
|
||||
update-source-version "$UPDATE_NIX_ATTR_PATH" "$version" "$hash"
|
||||
update-source-version --ignore-same-hash --version-key=rev "$UPDATE_NIX_ATTR_PATH" "$revision" "$hash"
|
||||
|
@ -19,6 +19,6 @@ for system in \
|
||||
x86_64-linux \
|
||||
x86_64-darwin \
|
||||
aarch64-darwin; do
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import $BASEDIR {}; hoppscotch.src.url" --system "$system" | tr -d '"')))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import $BASEDIR {}; hoppscotch.src.url" --system "$system" | tr -d '"')))
|
||||
(cd $BASEDIR && update-source-version hoppscotch $latestVersion $hash --system=$system --ignore-same-version)
|
||||
done
|
||||
|
@ -35,7 +35,7 @@ stdenvNoCC.mkDerivation rec {
|
||||
curl -Lo $tmp/I.Ming.ttf https://raw.githubusercontent.com/ichitenfont/I.Ming/$version/$version/I.Ming-$version.ttf
|
||||
install -DT -m444 $tmp/I.Ming.ttf $tmp/share/fonts/truetype/I.Ming/I.Ming.ttf
|
||||
rm $tmp/I.Ming.ttf
|
||||
hash=$(nix hash path --type sha256 --base32 --sri $tmp)
|
||||
hash=$(nix --extra-experimental-features nix-command hash path --type sha256 --base32 --sri $tmp)
|
||||
sed -i -E \
|
||||
-e "s/version = \"[0-9.]+\"/version = \"$version\"/" \
|
||||
-e "s|hash = \".*\"|hash = \"$hash\"|" \
|
||||
|
@ -37,7 +37,7 @@ printf '{\n' > "$dirname/hashes.nix"
|
||||
|
||||
for family in "${families[@]}"; do
|
||||
url="https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-${family}%40${version}/ibm-plex-${family}.zip"
|
||||
printf ' "%s" = "%s";\n' "$family" "$(nix-prefetch-url --unpack "$url" | xargs nix hash convert --hash-algo sha256)" >>"$dirname/hashes.nix"
|
||||
printf ' "%s" = "%s";\n' "$family" "$(nix-prefetch-url --unpack "$url" | xargs nix --extra-experimental-features nix-command hash convert --hash-algo sha256)" >>"$dirname/hashes.nix"
|
||||
done
|
||||
|
||||
printf '}\n' >> "$dirname/hashes.nix"
|
||||
|
@ -64,7 +64,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
version="$(jq -r .version <<<$core_json)"
|
||||
sha256="$(jq -r .sha256 <<<$core_json)"
|
||||
hash="$(nix hash to-sri --type sha256 "$sha256")"
|
||||
hash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$sha256")"
|
||||
|
||||
if [ ! "$oldVersion" = "$version" ]; then
|
||||
update-source-version jenkins "$version" "$hash"
|
||||
|
@ -28,6 +28,6 @@ for system in $systems; do
|
||||
unpack=""
|
||||
fi
|
||||
prefetch=$(nix-prefetch-url $unpack "$url")
|
||||
hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch)
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $prefetch)
|
||||
update-source-version jetbrains-toolbox $latestVersion $hash --system=$system --ignore-same-version
|
||||
done
|
||||
|
@ -20,7 +20,7 @@ if [[ "$latestVersion" == "$currentVersion" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
hash=$(nix hash convert --hash-algo sha256 --to sri $(nix-prefetch-url --unpack "https://github.com/AChep/keyguard-app/archive/refs/tags/${latestTag}.tar.gz"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $(nix-prefetch-url --unpack "https://github.com/AChep/keyguard-app/archive/refs/tags/${latestTag}.tar.gz"))
|
||||
update-source-version keyguard $latestVersion $hash
|
||||
|
||||
sed -i 's/tag = "r[0-9]\+\(\.[0-9]\+\)\?";/tag = "'"$latestTag"'";/g' "$ROOT/package.nix"
|
||||
|
@ -19,6 +19,6 @@ for i in \
|
||||
"x86_64-linux linux-x86_64" \
|
||||
"aarch64-linux linux-arm64"; do
|
||||
set -- $i
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(curl ${GITLAB_TOKEN:+-H "Private-Token: $GITLAB_TOKEN"} -sL https://gitlab.com/api/v4/projects/44042130/packages/generic/librewolf/$latestVersion/librewolf-$latestVersion-$2-package.tar.xz.sha256sum))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(curl ${GITLAB_TOKEN:+-H "Private-Token: $GITLAB_TOKEN"} -sL https://gitlab.com/api/v4/projects/44042130/packages/generic/librewolf/$latestVersion/librewolf-$latestVersion-$2-package.tar.xz.sha256sum))
|
||||
update-source-version librewolf-bin-unwrapped $latestVersion $hash --system=$1 --ignore-same-version
|
||||
done
|
||||
|
@ -11,7 +11,7 @@ for system in "aarch64-darwin darwin/arm64" "x86_64-linux linux/x64"; do
|
||||
arch="${1}"
|
||||
url=$(echo "${packages}" | grep "${2}")
|
||||
version="$(echo "${url}" | cut -d/ -f6)"
|
||||
hash=$(nix hash convert --hash-algo sha256 "$(nix-prefetch-url "${url}")")
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 "$(nix-prefetch-url "${url}")")
|
||||
|
||||
update-source-version lmstudio "${version}" "${hash}" --system="${arch}" --version-key="version_${arch}" \
|
||||
2> >(tee /dev/stderr) | grep -q "nothing to do" && exit
|
||||
|
@ -17,10 +17,10 @@ fi
|
||||
sed -i "s/version = \".*\"/version = \"${latestVersion}\"/" "$ROOT/package.nix"
|
||||
|
||||
DARWIN_x64_URL="https://github.com/localsend/localsend/releases/download/v${latestVersion}/LocalSend-${latestVersion}.dmg"
|
||||
DARWIN_X64_SHA=$(nix hash to-sri --type sha256 $(nix-prefetch-url ${DARWIN_x64_URL}))
|
||||
DARWIN_X64_SHA=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url ${DARWIN_x64_URL}))
|
||||
sed -i "/darwin/,/hash/{s|hash = \".*\"|hash = \"${DARWIN_X64_SHA}\"|}" "$ROOT/package.nix"
|
||||
|
||||
GIT_SRC_URL="https://github.com/localsend/localsend/archive/refs/tags/v${latestVersion}.tar.gz"
|
||||
GIT_SRC_SHA=$(nix hash to-sri --type sha256 $(nix-prefetch-url --unpack ${GIT_SRC_URL}))
|
||||
GIT_SRC_SHA=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --unpack ${GIT_SRC_URL}))
|
||||
sed -i "/linux/,/hash/{s|hash = \".*\"|hash = \"${GIT_SRC_SHA}\"|}" "$ROOT/package.nix"
|
||||
curl https://raw.githubusercontent.com/localsend/localsend/v${latestVersion}/app/pubspec.lock | yq . > $ROOT/pubspec.lock.json
|
||||
|
@ -18,6 +18,6 @@ for i in \
|
||||
"aarch64-linux arm64"; do
|
||||
set -- $i
|
||||
prefetch=$(nix-prefetch-url "https://github.com/mihomo-party-org/mihomo-party/releases/download/v$latestVersion/mihomo-party-linux-$latestVersion-$2.deb")
|
||||
hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch)
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $prefetch)
|
||||
update-source-version mihomo-party $latestVersion $hash --system=$1 --ignore-same-version
|
||||
done
|
||||
|
@ -67,7 +67,7 @@ writeShellScript "update-${pname}" ''
|
||||
for platform in ${lib.escapeShellArgs meta.platforms}; do
|
||||
arch="''${platforms[$platform]}"
|
||||
sha256=$(grep "${name}-$arch-$version.tar.xz" "$HOME/shasums" | head -1 | cut -d" " -f1)
|
||||
hash=$(nix hash to-sri --type sha256 "$sha256")
|
||||
hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$sha256")
|
||||
|
||||
update-source-version "${pname}" "$version" "$hash" --ignore-same-version --source-key="sources.$platform"
|
||||
done
|
||||
|
@ -58,7 +58,7 @@ echo
|
||||
echo "Verifying commit"
|
||||
git -C $repo verify-commit HEAD
|
||||
rm -rf $repo/.git
|
||||
newHash=$(nix hash-path $repo)
|
||||
newHash=$(nix --extra-experimental-features nix-command hash path $repo)
|
||||
rm -rf $tmpdir
|
||||
echo
|
||||
|
||||
|
@ -15,7 +15,7 @@ updateHash()
|
||||
|
||||
url="https://github.com/Ombi-app/Ombi/releases/download/v$version/$os-$arch.tar.gz"
|
||||
hash=$(nix-prefetch-url --type sha256 $url)
|
||||
sriHash="$(nix hash to-sri --type sha256 $hash)"
|
||||
sriHash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $hash)"
|
||||
|
||||
sed -i "s|$hashKey = \"[a-zA-Z0-9\/+-=]*\";|$hashKey = \"$sriHash\";|g" "$dirname/default.nix"
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ for system in \
|
||||
aarch64-linux \
|
||||
x86_64-darwin \
|
||||
aarch64-darwin; do
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url --unpack $(nix-instantiate --eval -E "with import ./. {}; pdfium-binaries.src.url" --system "$system" | tr -d '"')))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url --unpack $(nix-instantiate --eval -E "with import ./. {}; pdfium-binaries.src.url" --system "$system" | tr -d '"')))
|
||||
update-source-version pdfium-binaries $latestVersion $hash --system=$system --ignore-same-version
|
||||
done
|
||||
|
||||
@ -30,6 +30,6 @@ for system in \
|
||||
aarch64-linux \
|
||||
x86_64-darwin \
|
||||
aarch64-darwin; do
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url --unpack $(nix-instantiate --eval -E "with import ./. {}; pdfium-binaries-v8.src.url" --system "$system" | tr -d '"')))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url --unpack $(nix-instantiate --eval -E "with import ./. {}; pdfium-binaries-v8.src.url" --system "$system" | tr -d '"')))
|
||||
update-source-version pdfium-binaries-v8 $latestVersion $hash --system=$system --ignore-same-version
|
||||
done
|
||||
|
@ -23,7 +23,7 @@ src="$(nix-build -A "${UPDATE_NIX_ATTR_PATH}".src --no-out-link)"
|
||||
echo " url = \"${url}\";"
|
||||
|
||||
hash="$(nix-prefetch-url "${url}" --name "${UPDATE_NIX_PNAME}-${name,,}-${version}.tar.gz")"
|
||||
hash="$(nix hash convert --hash-algo sha256 "${hash}")"
|
||||
hash="$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 "${hash}")"
|
||||
|
||||
echo " hash = \"${hash}\";"
|
||||
|
||||
|
@ -19,6 +19,6 @@ for system in \
|
||||
aarch64-linux \
|
||||
x86_64-darwin \
|
||||
aarch64-darwin; do
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; phoenixd.src.url" --system "$system" | tr -d '"')))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; phoenixd.src.url" --system "$system" | tr -d '"')))
|
||||
update-source-version phoenixd $latestVersion $hash --system=$system --ignore-same-version
|
||||
done
|
||||
|
@ -18,7 +18,7 @@ fi
|
||||
|
||||
sed -i "s/\(tag = \"\${version}+\)[0-9]\+/\1${RunNumber}/" "$ROOT/package.nix"
|
||||
|
||||
hash=$(nix hash convert --hash-algo sha256 --to sri $(nix-prefetch-url --unpack "https://github.com/orz12/PiliPalaX/archive/refs/tags/${latestTag}.tar.gz"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $(nix-prefetch-url --unpack "https://github.com/orz12/PiliPalaX/archive/refs/tags/${latestTag}.tar.gz"))
|
||||
update-source-version pilipalax $latestVersion $hash
|
||||
|
||||
curl https://raw.githubusercontent.com/orz12/PiliPalaX/${latestTag}/pubspec.lock | yq . >$ROOT/pubspec.lock.json
|
||||
|
@ -10,9 +10,9 @@ version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
|
||||
linux_arm64_url=https://github.com/platformsh/cli/releases/download/$version/platform_${version}_linux_arm64.tar.gz
|
||||
linux_amd64_url=https://github.com/platformsh/cli/releases/download/$version/platform_${version}_linux_amd64.tar.gz
|
||||
darwin_all_url=https://github.com/platformsh/cli/releases/download/$version/platform_${version}_darwin_all.tar.gz
|
||||
linux_arm64_hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$linux_arm64_url"))
|
||||
linux_amd64_hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$linux_amd64_url"))
|
||||
darwin_all_hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$darwin_all_url"))
|
||||
linux_arm64_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$linux_arm64_url"))
|
||||
linux_amd64_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$linux_amd64_url"))
|
||||
darwin_all_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$darwin_all_url"))
|
||||
jq -n \
|
||||
--arg version "$version" \
|
||||
--arg darwin_all_hash "$darwin_all_hash" \
|
||||
|
@ -27,7 +27,7 @@ version="$(
|
||||
echo '{' >"${HASHES_FILE}"
|
||||
for arch in "${ARCHS[@]}"; do
|
||||
url="https://repo1.maven.org/maven2/io/grpc/protoc-gen-grpc-java/${version}/protoc-gen-grpc-java-${version}-${arch}.exe"
|
||||
hash=$(nix hash convert --hash-algo sha256 --to sri "$(nix-prefetch-url "${url}")")
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri "$(nix-prefetch-url "${url}")")
|
||||
echo " ${arch} = \"${hash}\";" >>"${HASHES_FILE}"
|
||||
done
|
||||
echo '}' >>"${HASHES_FILE}"
|
||||
|
@ -16,7 +16,7 @@ darwin_url=$(jq -r .downloadUrl <<< "$darwin_payload")
|
||||
darwin_hash=$(nix-prefetch-url $darwin_url)
|
||||
|
||||
# use friendlier hashes
|
||||
darwin_hash=$(nix hash convert --to sri --hash-algo sha256 "$darwin_hash")
|
||||
darwin_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$darwin_hash")
|
||||
|
||||
# linux
|
||||
|
||||
@ -31,8 +31,8 @@ linux_aarch64_hash=$(nix-prefetch-url $linux_aarch64_url)
|
||||
linux_x86_64_hash=$(nix-prefetch-url $linux_x86_64_url)
|
||||
|
||||
# use friendlier hashes
|
||||
linux_aarch64_hash=$(nix hash convert --to sri --hash-algo sha256 "$linux_aarch64_hash")
|
||||
linux_x86_64_hash=$(nix hash convert --to sri --hash-algo sha256 "$linux_x86_64_hash")
|
||||
linux_aarch64_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$linux_aarch64_hash")
|
||||
linux_x86_64_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$linux_x86_64_hash")
|
||||
|
||||
cat >sources.nix <<EOF
|
||||
# Generated by ./update.sh - do not update manually!
|
||||
|
@ -15,7 +15,7 @@ updateHash()
|
||||
|
||||
url="https://github.com/Readarr/Readarr/releases/download/v$version/Readarr.develop.$version.$os-core-$arch.tar.gz"
|
||||
hash=$(nix-prefetch-url --type sha256 $url)
|
||||
sriHash="$(nix hash to-sri --type sha256 $hash)"
|
||||
sriHash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $hash)"
|
||||
|
||||
sed -i "s|$hashKey = \"[a-zA-Z0-9\/+-=]*\";|$hashKey = \"$sriHash\";|g" "$dirname/package.nix"
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
#!nix-shell -i bash -p curl jq common-updater-scripts nix nix-prefetch findutils moreutils
|
||||
|
||||
prefetch-sri() {
|
||||
nix-prefetch-url "$1" | xargs nix hash to-sri --type sha256
|
||||
nix-prefetch-url "$1" | xargs nix --extra-experimental-features nix-command hash to-sri --type sha256
|
||||
}
|
||||
|
||||
res="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
|
||||
|
@ -55,7 +55,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
if [[ "x$UPDATE_NIX_OLD_VERSION" != "x$full_version" ]]; then
|
||||
download_url="https://packagecloud.io/pagerduty/rundeck/packages/java/org.rundeck/rundeck-$full_version.war/artifacts/rundeck-$full_version.war/download?distro_version_id=167"
|
||||
hash=$(curl -L "$download_url" | nix-hash --flat --type sha256 --base32 - | nix hash to-sri --type sha256)
|
||||
hash=$(curl -L "$download_url" | nix-hash --flat --type sha256 --base32 - | nix --extra-experimental-features nix-command hash to-sri --type sha256)
|
||||
update-source-version "$UPDATE_NIX_ATTR_PATH" "$full_version" "$hash"
|
||||
fi
|
||||
'';
|
||||
|
@ -17,7 +17,7 @@ latestBuildAarch64=$(jq '.id' <<< $latestBuildInfoAarch64)
|
||||
latestVersionAarch64=$(jq -r '.source_package.version' <<< $latestBuildInfoAarch64)
|
||||
latestPrettyVersionAarch64="${latestVersionAarch64%-*}"
|
||||
|
||||
darwinHash="$(nix hash convert --hash-algo sha256 --to sri "$(nix-prefetch-url "https://updates.signal.org/desktop/signal-desktop-mac-universal-${latestVersion}.dmg")")"
|
||||
darwinHash="$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri "$(nix-prefetch-url "https://updates.signal.org/desktop/signal-desktop-mac-universal-${latestVersion}.dmg")")"
|
||||
|
||||
echo "Updating signal-desktop for x86_64-linux"
|
||||
update-source-version signal-desktop-bin "$latestVersion" \
|
||||
|
@ -13,5 +13,5 @@ if [[ "$latestVersion" == "$currentVersion" ]]; then
|
||||
fi
|
||||
|
||||
nix-update sparkle --version $latestVersion --system x86_64-linux
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; sparkle.src.url" --system aarch64-linux | tr -d '"')))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; sparkle.src.url" --system aarch64-linux | tr -d '"')))
|
||||
update-source-version sparkle $latestVersion $hash --system=aarch64-linux --ignore-same-version
|
||||
|
@ -61,7 +61,7 @@ writeScript "update-standardnotes" ''
|
||||
upstreamPlatform="$2"
|
||||
url=$(getDownloadUrl "$upstreamPlatform")
|
||||
hash=$(nix-prefetch-url "$url" --type sha512)
|
||||
sriHash=$(nix hash to-sri --type sha512 $hash)
|
||||
sriHash=$(nix --extra-experimental-features nix-command hash to-sri --type sha512 $hash)
|
||||
setJsonKey .deb[\""$nixPlatform"\"].url "$url"
|
||||
setJsonKey .deb[\""$nixPlatform"\"].hash "$sriHash"
|
||||
}
|
||||
|
@ -2,12 +2,12 @@ new_src="$(nix-build --attr "pkgs.$PNAME.src" --no-out-link)"
|
||||
new_nnue_big_file="$(grep --perl-regexp --only-matching 'EvalFileDefaultNameBig "\Knn-(\w+).nnue' "$new_src/src/evaluate.h")"
|
||||
new_nnue_small_file="$(grep --perl-regexp --only-matching 'EvalFileDefaultNameSmall "\Knn-(\w+).nnue' "$new_src/src/evaluate.h")"
|
||||
new_nnue_big_hash="$(
|
||||
nix hash convert --hash-algo sha256 "$(
|
||||
nix --extra-experimental-features nix-command hash convert --hash-algo sha256 "$(
|
||||
nix-prefetch-url --type sha256 "https://tests.stockfishchess.org/api/nn/$new_nnue_big_file"
|
||||
)"
|
||||
)"
|
||||
new_nnue_small_hash="$(
|
||||
nix hash convert --hash-algo sha256 "$(
|
||||
nix --extra-experimental-features nix-command hash convert --hash-algo sha256 "$(
|
||||
nix-prefetch-url --type sha256 "https://tests.stockfishchess.org/api/nn/$new_nnue_small_file"
|
||||
)"
|
||||
)"
|
||||
|
@ -17,7 +17,7 @@ for TYPE in "${DICT_TYPES[@]}"; do
|
||||
URL="https://github.com/$ORG/$REPO/releases/download/v$VERSION/sudachi-dictionary-$VERSION-$TYPE.zip"
|
||||
|
||||
PLAIN_HASH=$(nix-prefetch-url --type sha256 "$URL" --unpack)
|
||||
HASH=$(nix hash convert --hash-algo sha256 --to sri "$PLAIN_HASH")
|
||||
HASH=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri "$PLAIN_HASH")
|
||||
|
||||
sed -i -E "/(${TYPE} = fetchzip \{|^ *url = .*${TYPE}\.zip\";\$)/,/^ *hash = / s|hash = \"[^\"]*\"|hash = \"$HASH\"|" package.nix
|
||||
done
|
||||
|
@ -19,7 +19,7 @@ function updatePlatform() {
|
||||
echo "Updating tailwindcss_3 for $NIXPLAT"
|
||||
|
||||
URL="https://github.com/tailwindlabs/tailwindcss/releases/download/v${LATEST_VERSION}/tailwindcss-${TAILWINDPLAT}"
|
||||
HASH=$(nix hash to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")")
|
||||
HASH=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")")
|
||||
|
||||
sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/package.nix"
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ yarn_hash=$(prefetch-yarn-deps yarn.lock)
|
||||
popd
|
||||
|
||||
# Use friendlier hashes
|
||||
yarn_hash=$(nix hash to-sri --type sha256 "$yarn_hash")
|
||||
yarn_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$yarn_hash")
|
||||
|
||||
common="./pkgs/applications/misc/tandoor-recipes/common.nix"
|
||||
sed -i -E -e "s#version = \".*\"#version = \"$version\"#" $common
|
||||
|
@ -99,7 +99,7 @@ stdenv.mkDerivation rec {
|
||||
if [[ "x$UPDATE_NIX_OLD_VERSION" != "x$version" ]]; then
|
||||
|
||||
revision=$(jq -r .revision <<<"$data")
|
||||
hash=$(nix hash to-sri "sha512:$(jq -r .download_sha512 <<<"$data")")
|
||||
hash=$(nix --extra-experimental-features nix-command hash to-sri "sha512:$(jq -r .download_sha512 <<<"$data")")
|
||||
|
||||
update-source-version "$UPDATE_NIX_ATTR_PATH" "$version" "$hash"
|
||||
update-source-version --ignore-same-hash --version-key=revision "$UPDATE_NIX_ATTR_PATH" "$revision" "$hash"
|
||||
|
@ -84,7 +84,7 @@ async function main() {
|
||||
process.exit(1);
|
||||
}
|
||||
const hash = child_process
|
||||
.execSync(`nix hash convert --hash-algo sha256 --to sri ${prefetchHash}`)
|
||||
.execSync(`nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri ${prefetchHash}`)
|
||||
.toString()
|
||||
.trim();
|
||||
/** @type {Info} */
|
||||
|
@ -67,7 +67,7 @@ writeShellScript "update-${pname}" ''
|
||||
for platform in ${lib.escapeShellArgs meta.platforms}; do
|
||||
arch="''${platforms[$platform]}"
|
||||
sha256=$(grep "${name}-$arch-$version.tar.xz" "$HOME/shasums" | head -1 | cut -d" " -f1)
|
||||
hash=$(nix hash to-sri --type sha256 "$sha256")
|
||||
hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$sha256")
|
||||
|
||||
update-source-version "${pname}" "$version" "$hash" --ignore-same-version --source-key="sources.$platform"
|
||||
done
|
||||
|
@ -15,7 +15,7 @@ snap_info=($(
|
||||
# "revision" is the actual version identifier; "version" is for human consumption.
|
||||
revision="${snap_info[0]}"
|
||||
sha512="${snap_info[1]}"
|
||||
sri=$(nix hash to-sri --type "sha512" $sha512)
|
||||
sri=$(nix --extra-experimental-features nix-command hash to-sri --type "sha512" $sha512)
|
||||
upstream_version="${snap_info[2]}"
|
||||
last_updated="${snap_info[3]}"
|
||||
|
||||
|
@ -32,7 +32,7 @@ for platform in "${!platforms[@]}"; do
|
||||
arch="${platforms[$platform]}"
|
||||
url="https://dl.typesense.org/releases/${version}/typesense-server-${version}-${arch}.tar.gz"
|
||||
sha256hash="$(nix-prefetch-url --type sha256 "$url")"
|
||||
hash="$(nix hash to-sri --type sha256 "$sha256hash")"
|
||||
hash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$sha256hash")"
|
||||
echo "$(jq --arg arch "$arch" \
|
||||
--arg platform "$platform" \
|
||||
--arg hash "$hash" \
|
||||
|
@ -10,9 +10,9 @@ version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
|
||||
linux_arm64_url=https://github.com/platformsh/cli/releases/download/$version/upsun_${version}_linux_arm64.tar.gz
|
||||
linux_amd64_url=https://github.com/platformsh/cli/releases/download/$version/upsun_${version}_linux_amd64.tar.gz
|
||||
darwin_all_url=https://github.com/platformsh/cli/releases/download/$version/upsun_${version}_darwin_all.tar.gz
|
||||
linux_arm64_hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$linux_arm64_url"))
|
||||
linux_amd64_hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$linux_amd64_url"))
|
||||
darwin_all_hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$darwin_all_url"))
|
||||
linux_arm64_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$linux_arm64_url"))
|
||||
linux_amd64_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$linux_amd64_url"))
|
||||
darwin_all_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$darwin_all_url"))
|
||||
jq -n \
|
||||
--arg version "$version" \
|
||||
--arg darwin_all_hash "$darwin_all_hash" \
|
||||
|
@ -15,7 +15,7 @@ function calc_hash () {
|
||||
local arch=$2
|
||||
url="https://releases.hashicorp.com/vault/${version}/vault_${version}_${arch}.zip"
|
||||
zip_hash=$(nix-prefetch-url --unpack $url)
|
||||
nix hash to-sri --type sha256 "$zip_hash"
|
||||
nix --extra-experimental-features nix-command hash to-sri --type sha256 "$zip_hash"
|
||||
}
|
||||
|
||||
replace_sha() {
|
||||
|
@ -7,7 +7,7 @@ version=$(curl -sS https://vivaldi.com/download/ | sed -rne 's/.*vivaldi-stable_
|
||||
|
||||
update_hash() {
|
||||
url="https://downloads.vivaldi.com/stable/vivaldi-stable_$version-1_$2.deb"
|
||||
hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$url"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "$url"))
|
||||
update-source-version vivaldi "$version" "$hash" --system=$1 --ignore-same-version
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ for i in \
|
||||
"aarch64-linux arm64"; do
|
||||
set -- $i
|
||||
prefetch=$(nix-prefetch-url "https://github.com/wavetermdev/waveterm/releases/download/v$latestVersion/waveterm-linux-$2-$latestVersion.deb")
|
||||
hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch)
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $prefetch)
|
||||
update-source-version waveterm $latestVersion $hash --system=$1 --ignore-same-version
|
||||
done
|
||||
|
||||
@ -29,6 +29,6 @@ for i in \
|
||||
"aarch64-darwin arm64"; do
|
||||
set -- $i
|
||||
prefetch=$(nix-prefetch-url "https://github.com/wavetermdev/waveterm/releases/download/v$latestVersion/Wave-darwin-$2-$latestVersion.zip")
|
||||
hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch)
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $prefetch)
|
||||
update-source-version waveterm $latestVersion $hash --system=$1 --ignore-same-version
|
||||
done
|
||||
|
@ -40,7 +40,7 @@ do
|
||||
}
|
||||
')
|
||||
url+=("https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_"$version"_"$i".deb")
|
||||
hash+=("$(nix hash to-sri --type sha256 $sha256sum)")
|
||||
hash+=("$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $sha256sum)")
|
||||
done
|
||||
|
||||
cat >sources.nix <<EOF
|
||||
|
@ -24,7 +24,7 @@ updateHash()
|
||||
echo "Updating the hash for the \`${system}\` system..."
|
||||
url="https://whisparr.servarr.com/v1/update/nightly/updatefile?runtime=netcore&version=${version}&arch=${arch}&os=${os}"
|
||||
hash=$(nix-prefetch-url --type sha256 --name "whisparr-$system-$version.tar.gz" "$url")
|
||||
sriHash="$(nix hash to-sri --type sha256 "$hash")"
|
||||
sriHash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$hash")"
|
||||
|
||||
sed -i "s#$hashKey = \"[a-zA-Z0-9\/+-=]*\"#$hashKey = \"$sriHash\"#" "$dirname/package.nix"
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ do
|
||||
}
|
||||
')
|
||||
url+=("https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.xunlei.download/com.xunlei.download_"$version"_"$i".deb")
|
||||
hash+=("$(nix hash convert --to sri --hash-algo sha256 $sha256sum)")
|
||||
hash+=("$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $sha256sum)")
|
||||
done
|
||||
|
||||
cat >sources.nix <<EOF
|
||||
|
@ -134,12 +134,12 @@ def calculate_sri_hash(owner: str, repo: str, latest_commit: str) -> str:
|
||||
new_hash = run_command(f"nix-prefetch-url --unpack --type sha256 {prefetch_url} 2>/dev/null")
|
||||
|
||||
if not new_hash.startswith("sha256-"):
|
||||
new_hash = run_command(f"nix hash to-sri --type sha256 {new_hash} 2>/dev/null")
|
||||
new_hash = run_command(f"nix --extra-experimental-features nix-command hash to-sri --type sha256 {new_hash} 2>/dev/null")
|
||||
|
||||
if not new_hash.startswith("sha256-"):
|
||||
print("Warning: Failed to get SRI hash directly, trying alternative method...")
|
||||
raw_hash = run_command(f"nix-prefetch-url --type sha256 {prefetch_url} 2>/dev/null")
|
||||
new_hash = run_command(f"nix hash to-sri --type sha256 {raw_hash} 2>/dev/null")
|
||||
new_hash = run_command(f"nix --extra-experimental-features nix-command hash to-sri --type sha256 {raw_hash} 2>/dev/null")
|
||||
except Exception as e:
|
||||
raise RuntimeError(f"Error calculating hash: {e}")
|
||||
|
||||
|
@ -21,9 +21,9 @@ echo >&2 "=== Downloading packages and computing hashes..."
|
||||
# causes cross compiling headaches; using nix-prefetch-url with
|
||||
# hard-coded URLs is simpler. Keep these URLs in sync with the ones
|
||||
# in package.nix where `srcs` is defined.
|
||||
hash_aarch64_darwin=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "https://zoom.us/client/${version_aarch64_darwin}/zoomusInstallerFull.pkg?archType=arm64"))
|
||||
hash_x86_64_darwin=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "https://zoom.us/client/${version_x86_64_darwin}/zoomusInstallerFull.pkg"))
|
||||
hash_x86_64_linux=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "https://zoom.us/client/${version_x86_64_linux}/zoom_x86_64.pkg.tar.xz"))
|
||||
hash_aarch64_darwin=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "https://zoom.us/client/${version_aarch64_darwin}/zoomusInstallerFull.pkg?archType=arm64"))
|
||||
hash_x86_64_darwin=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "https://zoom.us/client/${version_x86_64_darwin}/zoomusInstallerFull.pkg"))
|
||||
hash_x86_64_linux=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "https://zoom.us/client/${version_x86_64_linux}/zoom_x86_64.pkg.tar.xz"))
|
||||
|
||||
echo >&2 "=== Updating package.nix ..."
|
||||
# update-source-version expects to be at the root of nixpkgs
|
||||
|
@ -43,7 +43,7 @@ platform_sources () {
|
||||
|
||||
[[ -z "$url" || -z "$hash" ]] && continue
|
||||
|
||||
hash=$(nix hash convert --to sri --hash-algo sha512 "$hash")
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha512 "$hash")
|
||||
|
||||
echo " $rid = {
|
||||
url = \"$url\";
|
||||
@ -73,7 +73,7 @@ generate_package_list() {
|
||||
if hash=$(curl -s --head "$url" -o /dev/null -w '%header{x-ms-meta-sha512}') && [[ -n "$hash" ]]; then
|
||||
# Undocumented fast path for nuget.org
|
||||
# https://github.com/NuGet/NuGetGallery/issues/9433#issuecomment-1472286080
|
||||
hash=$(nix hash convert --to sri --hash-algo sha512 "$hash")
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha512 "$hash")
|
||||
elif {
|
||||
catalog_url=$(curl -sL --compressed "${nuget_registration_base_url}${pkg,,}/${version,,}.json" | jq -r ".catalogEntry") && [[ -n "$catalog_url" ]] &&
|
||||
catalog=$(curl -sL "$catalog_url") && [[ -n "$catalog" ]] &&
|
||||
@ -81,11 +81,11 @@ generate_package_list() {
|
||||
hash=$(jq -er '.packageHash' <<<"$catalog") && [[ -n "$hash" ]]
|
||||
}; then
|
||||
# Documented but slower path (requires 2 requests)
|
||||
hash=$(nix hash convert --to sri --hash-algo "${hash_algorithm,,}" "$hash")
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo "${hash_algorithm,,}" "$hash")
|
||||
elif hash=$(nix-prefetch-url "$url" --type sha512); then
|
||||
# Fallback to downloading and hashing locally
|
||||
echo "Failed to fetch hash from nuget for $url, falling back to downloading locally" >&2
|
||||
hash=$(nix hash convert --to sri --hash-algo sha512 "$hash")
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha512 "$hash")
|
||||
else
|
||||
echo "Failed to fetch hash for $url" >&2
|
||||
exit 1
|
||||
|
@ -2,7 +2,7 @@
|
||||
# https://www.oracle.com/java/technologies/javase/graalvm-jdk23-archive-downloads.html
|
||||
# Then run this script:
|
||||
# $ rg -No "(https://.+)\"" -r '$1' pkgs/development/compilers/graalvm/graalvm-oracle/hashes.nix | \
|
||||
# parallel -k 'echo {}; nix hash convert --hash-algo sha256 --to sri $(curl -s {}.sha256)'
|
||||
# parallel -k 'echo {}; nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $(curl -s {}.sha256)'
|
||||
{
|
||||
"23" = {
|
||||
"aarch64-linux" = {
|
||||
|
@ -38,6 +38,6 @@ declare -a platforms=(
|
||||
for platform in "${platforms[@]}"; do
|
||||
read -r system arch <<< "$platform"
|
||||
url="https://cef-builds.spotifycdn.com/cef_binary_${cef_version}+g${git_revision}+chromium-${chromium_version}_linux${arch}_minimal.tar.bz2"
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 "$(nix-prefetch-url --quiet "$url")")
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$(nix-prefetch-url --quiet "$url")")
|
||||
update-source-version libcef "$cef_version" "$hash" --system="$system" --ignore-same-version
|
||||
done
|
||||
|
@ -23,7 +23,7 @@ for url_and_key in "${url_and_key_list[@]}"; do
|
||||
name=$(echo "$url_and_key" | cut -d' ' -f3)
|
||||
|
||||
echo "prefetching ${url}..."
|
||||
hash=$(nix hash to-sri --type sha256 $(nix-prefetch-url --unpack "$url" --name "$name"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --unpack "$url" --name "$name"))
|
||||
|
||||
echo " $key = {" >> $hashfile
|
||||
echo " name = \"$name\";" >> $hashfile
|
||||
|
@ -6,7 +6,7 @@ prefetch() {
|
||||
url=$(NIX_PATH=.. nix-instantiate --eval -E "$expr" | jq -r)
|
||||
echo "$url"
|
||||
sha256=$(nix-prefetch-url "$url")
|
||||
nix hash convert --to sri --hash-algo sha256 "$sha256"
|
||||
nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$sha256"
|
||||
echo
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ for package in "${packages[@]}"; do
|
||||
if [ "${version}" != "${old_version}" ]; then
|
||||
url="https://pypi.io/packages/source/m/${package//-/_}/${package//-/_}-${version}.tar.gz"
|
||||
hash=$(nix-prefetch-url --type sha256 $url)
|
||||
sri_hash="$(nix hash to-sri --type sha256 $hash)"
|
||||
sri_hash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $hash)"
|
||||
|
||||
awk -i inplace -v pkg="\"$package_short_name\"" -v new_version="$version" -v new_sha256="$sri_hash" '
|
||||
# Match the line containing the package name
|
||||
|
@ -13,7 +13,7 @@ prefetch() {
|
||||
url=$(NIX_PATH=.. nix-instantiate --eval -E "$expr" | jq -r)
|
||||
|
||||
sha256=$(nix-prefetch-url "$url")
|
||||
hash=$(nix hash convert --to sri --hash-algo sha256 "$sha256")
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$sha256")
|
||||
|
||||
echo -e " cp${1} = \"${hash}\";" >>$outfile
|
||||
echo
|
||||
|
@ -37,7 +37,7 @@ for url_and_key in "${url_and_key_list[@]}"; do
|
||||
name=$(echo "$url_and_key" | cut -d' ' -f3)
|
||||
|
||||
echo "prefetching ${url}..."
|
||||
hash=$(nix hash convert --hash-algo sha256 $(nix-prefetch-url "$url" --name "$name"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 $(nix-prefetch-url "$url" --name "$name"))
|
||||
|
||||
echo " $key = {" >>$hashfile
|
||||
echo " name = \"$name\";" >>$hashfile
|
||||
|
@ -37,7 +37,7 @@ for url_and_key in "${url_and_key_list[@]}"; do
|
||||
name=$(echo "$url_and_key" | cut -d' ' -f3)
|
||||
|
||||
echo "prefetching ${url}..."
|
||||
hash=$(nix hash convert --hash-algo sha256 $(nix-prefetch-url "$url" --name "$name"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 $(nix-prefetch-url "$url" --name "$name"))
|
||||
|
||||
echo " $key = {" >>$hashfile
|
||||
echo " name = \"$name\";" >>$hashfile
|
||||
|
@ -36,7 +36,7 @@ for url_and_key in "${url_and_key_list[@]}"; do
|
||||
name=$(echo "$url_and_key" | cut -d' ' -f3)
|
||||
|
||||
echo "prefetching ${url}..."
|
||||
hash=$(nix hash convert --hash-algo sha256 $(nix-prefetch-url "$url" --name "$name"))
|
||||
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 $(nix-prefetch-url "$url" --name "$name"))
|
||||
|
||||
echo " $key = {" >>$hashfile
|
||||
echo " name = \"$name\";" >>$hashfile
|
||||
|
@ -371,7 +371,7 @@ for package in "${packages[@]}"; do
|
||||
|
||||
url="https://pypi.io/packages/source/t/${package}/${package//-/_}-${version}.tar.gz"
|
||||
hash=$(nix-prefetch-url --type sha256 $url)
|
||||
sri_hash="$(nix hash convert --hash-algo sha256 --to sri $hash)"
|
||||
sri_hash="$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $hash)"
|
||||
package_short="${package#types-aiobotocore-}"
|
||||
|
||||
awk -i inplace -v pkg="$package" -v pkg_short="$package_short" -v ver="$version" -v hash="$sri_hash" '
|
||||
|
@ -28,5 +28,5 @@ sed -i -E -e "s#version = \".*\"#version = \"$version\"#" common.nix
|
||||
|
||||
# Woodpecker repository
|
||||
src_hash=$(nix-prefetch-url --type sha256 --unpack "https://github.com/woodpecker-ci/woodpecker/releases/download/v$version/woodpecker-src.tar.gz")
|
||||
src_hash=$(nix hash to-sri --type sha256 "$src_hash")
|
||||
src_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$src_hash")
|
||||
sed -i -E -e "s#srcHash = \".*\"#srcHash = \"$src_hash\"#" common.nix
|
||||
|
@ -29,7 +29,7 @@ printf "{ \"_comment\": \"@generated by pkgs/development/tools/infisical/update.
|
||||
for arch in "${ARCHS[@]}"; do
|
||||
IFS=: read -r arch_name arch_target <<< "$arch"
|
||||
sha256hash="$(nix-prefetch-url --type sha256 "https://github.com/infisical/infisical/releases/download/${RELEASE_NAME}/infisical_${VERSION}_${arch_target}.tar.gz")"
|
||||
srihash="$(nix hash to-sri --type sha256 "$sha256hash")"
|
||||
srihash="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$sha256hash")"
|
||||
echo ", \"$arch_name\": \"$srihash\"" >> "$HFILE"
|
||||
done
|
||||
echo "}" >> "$HFILE"
|
||||
|
@ -24,7 +24,7 @@ rover_tar_url="https://github.com/apollographql/rover/archive/refs/tags/${rover_
|
||||
} < <(nix-prefetch-url "$rover_tar_url" --unpack --type sha256 --print-path)
|
||||
|
||||
# Convert hash to SRI representation
|
||||
rover_sri_hash=$(nix hash to-sri --type sha256 "$rover_hash")
|
||||
rover_sri_hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$rover_hash")
|
||||
|
||||
# Update rover version.
|
||||
sed --in-place \
|
||||
|
@ -21,5 +21,5 @@ echo "[{\"commitMessage\":\"$ATTR: $PREV -> $NEXT\"}]"
|
||||
|
||||
# update hash
|
||||
PREV=$(nix eval --raw -f default.nix $ATTR.src.outputHash)
|
||||
NEXT=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 --unpack $(nix eval --raw -f default.nix $ATTR.src.url)))
|
||||
NEXT=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 --unpack $(nix eval --raw -f default.nix $ATTR.src.url)))
|
||||
sed -i "s|$PREV|$NEXT|" "$FILE"
|
||||
|
@ -4,7 +4,7 @@
|
||||
# To get these, run:
|
||||
#
|
||||
# ```
|
||||
# for tool in alfred batctl batman-adv; do nix-prefetch-url https://downloads.open-mesh.org/batman/releases/batman-adv-2025.2/$tool-2025.2.tar.gz --type sha256 | xargs nix hash convert --hash-algo sha256 --to sri; done
|
||||
# for tool in alfred batctl batman-adv; do nix-prefetch-url https://downloads.open-mesh.org/batman/releases/batman-adv-2025.2/$tool-2025.2.tar.gz --type sha256 | xargs nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri; done
|
||||
# ```
|
||||
sha256 = {
|
||||
alfred = "sha256-Q0fR5LB5Svv2sXGoV7mjx9UaKR/FTxbNrZLH99HNtRo=";
|
||||
|
@ -22,7 +22,7 @@ rec {
|
||||
|
||||
Run the following command:
|
||||
```
|
||||
nix hash path $(nix build --print-out-paths -f '<nixpkgs>' make-minimal-bootstrap-sources)
|
||||
nix --extra-experimental-features nix-command hash path $(nix build --print-out-paths -f '<nixpkgs>' make-minimal-bootstrap-sources)
|
||||
```
|
||||
|
||||
# Why do we need this `.nar` archive?
|
||||
|
@ -27,7 +27,7 @@ OLD_VERSION="$(nix-instantiate --eval -E "with import $NIXPKGS_PATH {}; \
|
||||
if [ ! "$OLD_VERSION" = "$LATEST_VERSION" ]; then
|
||||
echo "Attempting to update etcd from $OLD_VERSION to $LATEST_VERSION"
|
||||
ETCD_SRC_HASH=$(nix-prefetch-url --quiet --unpack https://github.com/etcd-io/etcd/archive/refs/tags/${LATEST_TAG}.tar.gz)
|
||||
ETCD_SRC_HASH=$(nix hash to-sri --type sha256 $ETCD_SRC_HASH)
|
||||
ETCD_SRC_HASH=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $ETCD_SRC_HASH)
|
||||
|
||||
setKV () {
|
||||
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" "$ETCD_PATH/default.nix"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user