treewide: use nix-instantiate --eval --raw in update scripts (#558426)

This commit is contained in:
Yohann Boniface
2026-09-04 21:41:53 +00:00
committed by GitHub
20 changed files with 24 additions and 24 deletions

View File

@@ -13,7 +13,7 @@ fi
REPO="advplyr/audiobookshelf"
NEW_VER=$(list-git-tags --url=https://github.com/$REPO | rg 'v[0-9\.]*$' | sed -e 's/^v//' | sort -V | tail -n 1)
OLD_VER=$(nix-instantiate --eval -A audiobookshelf.version | jq --exit-status --raw-output)
OLD_VER=$(nix-instantiate --eval --raw -A audiobookshelf.version)
if [ "$NEW_VER" == "$OLD_VER" ]; then
echo "No update needed."

View File

@@ -6,7 +6,7 @@ set -eu -o pipefail
version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
https://api.github.com/repos/fxsth/audiothekar/releases/latest | jq -e -r .tag_name | tail -c +2)
old_version=$(nix-instantiate --eval -A audiothekar.version | jq -e -r)
old_version=$(nix-instantiate --eval --raw -A audiothekar.version)
if [[ $version == "$old_version" ]]; then
echo "New version same as old version, nothing to do." >&2

View File

@@ -6,7 +6,7 @@ set -eu -o pipefail
version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
https://api.github.com/repos/NickvisionApps/Cavalier/releases/latest | jq -e -r .tag_name)
old_version=$(nix-instantiate --eval -A cavalier.version | jq -e -r)
old_version=$(nix-instantiate --eval --raw -A cavalier.version)
if [[ $version == "$old_version" ]]; then
echo "New version same as old version, nothing to do." >&2

View File

@@ -6,7 +6,7 @@ set -o pipefail
OWNER="Freika"
REPO="dawarich"
old_version=$(nix-instantiate --eval -A 'dawarich.version' default.nix | tr -d '"')
old_version=$(nix-instantiate --eval --raw -A dawarich.version)
version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} "https://api.github.com/repos/$OWNER/$REPO/releases/latest" | jq -r ".tag_name")
echo "Updating to $version"

View File

@@ -6,7 +6,7 @@ set -eu -o pipefail
version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
https://api.github.com/repos/NickvisionApps/Denaro/releases/latest | jq -e -r .tag_name)
old_version=$(nix-instantiate --eval -A denaro.version | jq -e -r)
old_version=$(nix-instantiate --eval --raw -A denaro.version)
if [[ $version == "$old_version" ]]; then
echo "New version same as old version, nothing to do." >&2

View File

@@ -6,7 +6,7 @@ set -eu -o pipefail
version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
https://api.github.com/repos/processone/ejabberd/releases/latest | jq -e -r .tag_name)
old_version=$(nix-instantiate --eval -A ejabberd.version | jq -e -r)
old_version=$(nix-instantiate --eval --raw -A ejabberd.version)
if [[ $version == "$old_version" ]]; then
echo "New version same as old version, nothing to do." >&2

View File

@@ -7,7 +7,7 @@ let latest = ^list-git-tags --url=https://github.com/ghostty-org/ghostty
| last
| str trim --left --char "v"
let current = ^nix-instantiate --eval -A ghostty.version | str trim -c '"'
let current = ^nix-instantiate --eval --raw -A ghostty.version
if $latest == $current {
print "Up to date!"

View File

@@ -10,8 +10,8 @@ if [[ "$latest_version" = "$UPDATE_NIX_OLD_VERSION" ]]; then
exit 0
fi
old_src_hash=$(nix-instantiate --eval -A gnucash.src.outputHash | tr -d '"')
old_src_doc_hash=$(nix-instantiate --eval -A gnucash.docs.src.outputHash | tr -d '"')
old_src_hash=$(nix-instantiate --eval --raw -A gnucash.src.outputHash)
old_src_doc_hash=$(nix-instantiate --eval --raw -A gnucash.docs.src.outputHash)
src_hash=$(nix-prefetch-url "https://github.com/Gnucash/gnucash/releases/download/$latest_version/gnucash-$latest_version.tar.bz2")
src_hash=$(nix-hash --to-sri --type sha256 "$src_hash")

View File

@@ -10,7 +10,7 @@ branch="main"
commit=$(curl -s "https://api.github.com/repos/$owner/$repo/branches/$branch" | jq -r .commit.sha)
date=$(curl -s "https://api.github.com/repos/$owner/$repo/commits/$commit" | jq -r .commit.committer.date | cut -d'T' -f1)
current_version=$(nix-instantiate --eval -A ironcalc.version 2>/dev/null | tr -d '"' || echo "0.0.0")
current_version=$(nix-instantiate --eval --raw -A ironcalc.version)
base_version=$(echo "$current_version" | sed -E 's/-unstable-.*//')
new_version="$base_version-unstable-$date"

View File

@@ -26,7 +26,7 @@ yarn-berry-fetcher missing-hashes "${src_path}/client/yarn.lock" >"${package_dir
echo "Updating offline cache hash…"
offline_cache_hash=$(yarn-berry-fetcher prefetch "${src_path}/client/yarn.lock" "${package_dir}/missing-hashes.json")
old_hash=$(nix-instantiate --eval --expr "with import ./. {}; koito.client.offlineCache.outputHash" --raw)
old_hash=$(nix-instantiate --eval --raw -A koito.client.offlineCache.outputHash)
sed -i "s|${old_hash}|${offline_cache_hash}|" "${package_dir}/client.nix"
echo "Done."

View File

@@ -4,8 +4,8 @@
set -eu -o pipefail
ATTR=legends-of-equestria
DOWNLOADS_PAGE="$(curl -s "$(nix-instantiate --eval -A "$ATTR.meta.downloadPage" | tr -d '"')")"
OLD_VERSION="$(nix-instantiate --eval -A "$ATTR.version" | tr -d '"')"
DOWNLOADS_PAGE="$(curl -s "$(nix-instantiate --eval --raw -A "$ATTR.meta.downloadPage")")"
OLD_VERSION="$(nix-instantiate --eval --raw -A "$ATTR.version")"
NIX_FILE="$(nix-instantiate --eval -A "$ATTR.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/')"
TMP=$(mktemp -d)

View File

@@ -47,7 +47,7 @@ cat > $SOURCE_NIX <<-EOF
}
EOF
GO_HASH="$(nix-instantiate --eval -A mailpit.vendorHash | tr -d '"')"
GO_HASH="$(nix-instantiate --eval --raw -A mailpit.vendorHash)"
VENDOR_HASH=$(extractVendorHash "$GO_HASH")
cat > $SOURCE_NIX <<-EOF

View File

@@ -8,7 +8,7 @@ set -eu -o pipefail
version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
https://api.github.com/repos/LavaGang/MelonLoader.Installer/releases/latest | jq -e -r .tag_name)
old_version=$(nix-instantiate --eval -A melonloader-installer.version | jq -e -r)
old_version=$(nix-instantiate --eval --raw -A melonloader-installer.version)
if [[ $version == "$old_version" ]]; then
echo "New version same as old version, nothing to do." >&2

View File

@@ -3,14 +3,14 @@
set -euo pipefail
old_version=$(nix-instantiate --eval -A musicfree-desktop.version | tr -d '"')
old_version=$(nix-instantiate --eval --raw -A musicfree-desktop.version)
new_version=$(curl -sL ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} https://api.github.com/repos/maotoumao/MusicFreeDesktop/releases/latest | jq -r .tag_name | tr -d v)
if [ "$old_version" == "$new_version" ]; then
echo "Already up to date" >&2
exit
fi
patch=$(dirname $(nix-instantiate --eval -A musicfree-desktop.meta.position | tr -d '"' | cut -d : -f 1))/bump-deps.patch
patch=$(dirname $(nix-instantiate --eval --raw -A musicfree-desktop.meta.position | cut -d : -f 1))/bump-deps.patch
export HOME=$(mktemp -d)
pushd $HOME

View File

@@ -6,7 +6,7 @@ set -eu -o pipefail
version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
https://api.github.com/repos/nkallen/plasticity/releases/latest | jq -e -r ".tag_name | .[1:]")
old_version=$(nix-instantiate --eval -A plasticity.version | jq -e -r)
old_version=$(nix-instantiate --eval --raw -A plasticity.version)
if [[ $version == "$old_version" ]]; then
echo "New version same as old version, nothing to do." >&2

View File

@@ -13,7 +13,7 @@ else
nix-update --format --use-github-releases ramalama
fi
version="$(nix-instantiate --eval -A ramalama.version | jq --raw-output .)"
version="$(nix-instantiate --eval --raw -A ramalama.version)"
image_name="quay.io/ramalama/ramalama"
image_tag="${version%.*}"

View File

@@ -4,12 +4,12 @@
set -euo pipefail
# so that update bot doesn't try to update renpyMinimal
if [[ -n "${UPDATE_NIX_ATTR_PATH:-}" ]] && [[ "${UPDATE_NIX_ATTR_PATH:-}" != renpy ]];
if [[ -n "${UPDATE_NIX_ATTR_PATH:-}" ]] && [[ "${UPDATE_NIX_ATTR_PATH:-}" != renpy ]]; then
exit
fi
attr() {
nix-instantiate --eval -A renpy.$1 | tr -d '"'
nix-instantiate --eval --raw -A renpy."$1"
}
old_version="$(attr version)"

View File

@@ -5,7 +5,7 @@ set -euo pipefail
new_version="$(curl -s "https://api.github.com/repos/retrospy/RetroSpy/releases?per_page=1" | jq -r '.[0].tag_name')"
new_version=${new_version#v}
old_version=$(nix-instantiate --eval -A retrospy.version | jq -e -r)
old_version=$(nix-instantiate --eval --raw -A retrospy.version)
if [[ "$new_version" == "$old_version" ]]; then
echo "Up to date"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash jq zon2nix wget
commit=$(nix-instantiate --eval -A river-bedload.src.rev | jq --raw-output)
commit=$(nix-instantiate --eval --raw -A river-bedload.src.rev)
wget "https://git.sr.ht/~novakane/river-bedload/blob/${commit}/build.zig.zon"
zon2nix build.zig.zon >pkgs/by-name/ri/river-bedload/build.zig.zon.nix

View File

@@ -7,7 +7,7 @@
set -euo pipefail
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
old_version=$(nix-instantiate --eval -A 'umami.version' default.nix | tr -d '"' || echo "0.0.1")
old_version=$(nix-instantiate --eval --raw -A umami.version)
version=$(curl -s "https://api.github.com/repos/umami-software/umami/releases/latest" | jq -r ".tag_name")
version="${version#v}"