antigravity-cli: fix updateScript version handling

Expose the upstream version separately from the build id so nixpkgs-update can find and rewrite the package version. Keep wholeVersion derived for the upstream download URL.

The update script now updates version and buildId separately while preserving the existing per-system hash update flow.

Assisted-by: OpenAI Codex (GPT-5)
This commit is contained in:
Fida Waseque Choudhury
2026-07-04 18:56:48 +06:00
parent 536c906eb9
commit 1edf586e55
2 changed files with 9 additions and 4 deletions
+3 -2
View File
@@ -6,8 +6,9 @@
versionCheckHook,
}:
let
wholeVersion = "1.0.12-6156052174077952"; # unfortunately this has dumb versioning
version = builtins.head (lib.splitString "-" wholeVersion);
version = "1.0.12";
buildId = "6156052174077952";
wholeVersion = "${version}-${buildId}";
throwSystem = throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}";
+6 -2
View File
@@ -3,6 +3,7 @@
set -euo pipefail
packageFile=pkgs/by-name/an/antigravity-cli/package.nix
baseUrl=https://storage.googleapis.com/antigravity-public/antigravity-cli
currentVersion=$(nix-instantiate --eval --raw -E "with import ./. {}; antigravity-cli.version or (lib.getVersion antigravity-cli)")
@@ -15,8 +16,11 @@ fi
# urls unfortunately include a weird buildid that make it hard to get
latestWholeVersion=$(curl $baseUrl/$latestVersion/manifest.json | jq -r '.platforms."linux-x64".url' | cut -d/ -f6)
latestBuildId=${latestWholeVersion#*-}
currentBuildId=$(sed -n 's/.*buildId = "\([^"]*\)";.*/\1/p' "$packageFile")
update-source-version --version-key=wholeVersion antigravity-cli $latestWholeVersion || true
sed -i "s/buildId = \"$currentBuildId\";/buildId = \"$latestBuildId\";/" "$packageFile"
update-source-version --version-key=version antigravity-cli $latestVersion || true
for system in \
x86_64-linux \
@@ -25,5 +29,5 @@ for system in \
aarch64-darwin; do
hash=$(nix store prefetch-file --json --hash-type sha256 \
$(nix-instantiate --eval --raw -E "with import ./. {}; antigravity-cli.src.url" --system "$system") | jq -r '.hash')
update-source-version --version-key=wholeVersion antigravity-cli $latestWholeVersion $hash --system=$system --ignore-same-version
update-source-version --version-key=version antigravity-cli $latestVersion $hash --system=$system --ignore-same-version
done