Skip to content

Commit 4564f13

Browse files
antigravity-hub: init at 2.0.10
Assisted-by: Antigravity (Gemini 3.5 Flash (High)), Claude Opus 4.8 (1M context)
1 parent a4bce9d commit 4564f13

3 files changed

Lines changed: 313 additions & 0 deletions

File tree

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
{
2+
alsa-lib,
3+
asar,
4+
at-spi2-atk,
5+
at-spi2-core,
6+
atk,
7+
autoPatchelfHook,
8+
copyDesktopItems,
9+
cairo,
10+
cups,
11+
dbus,
12+
expat,
13+
fetchurl,
14+
fontconfig,
15+
freetype,
16+
gdk-pixbuf,
17+
glib,
18+
gsettings-desktop-schemas,
19+
gtk3,
20+
lib,
21+
libdrm,
22+
libgbm,
23+
libGL,
24+
libglvnd,
25+
libnotify,
26+
libpulseaudio,
27+
libsecret,
28+
libuuid,
29+
libx11,
30+
libxcb,
31+
libxcomposite,
32+
libxcursor,
33+
libxdamage,
34+
libxext,
35+
libxfixes,
36+
libxi,
37+
libxkbcommon,
38+
libxml2,
39+
libxrandr,
40+
libxrender,
41+
libxshmfence,
42+
libxt,
43+
libxtst,
44+
makeDesktopItem,
45+
makeWrapper,
46+
mesa,
47+
nspr,
48+
nss,
49+
pango,
50+
passwordStore ? "basic",
51+
stdenv,
52+
systemd,
53+
vulkan-loader,
54+
wayland,
55+
xdg-utils,
56+
}:
57+
58+
let
59+
desktopLibs = [
60+
alsa-lib
61+
at-spi2-atk
62+
at-spi2-core
63+
atk
64+
cairo
65+
cups
66+
dbus
67+
expat
68+
fontconfig
69+
freetype
70+
gdk-pixbuf
71+
glib
72+
gsettings-desktop-schemas
73+
gtk3
74+
libdrm
75+
libgbm
76+
libGL
77+
libglvnd
78+
libnotify
79+
libpulseaudio
80+
libsecret
81+
libuuid
82+
libx11
83+
libxcb
84+
libxcomposite
85+
libxcursor
86+
libxdamage
87+
libxext
88+
libxfixes
89+
libxi
90+
libxkbcommon
91+
libxml2
92+
libxrandr
93+
libxrender
94+
libxshmfence
95+
libxt
96+
libxtst
97+
mesa
98+
nspr
99+
nss
100+
pango
101+
stdenv.cc.cc
102+
systemd
103+
vulkan-loader
104+
wayland
105+
];
106+
107+
sources = builtins.fromJSON (builtins.readFile ./sources.json);
108+
systemSource =
109+
sources.sources.${stdenv.hostPlatform.system}
110+
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
111+
in
112+
stdenv.mkDerivation {
113+
pname = "antigravity-hub";
114+
version = sources.version;
115+
116+
src = fetchurl {
117+
url = systemSource.url;
118+
hash = systemSource.sha256;
119+
};
120+
121+
sourceRoot = systemSource.sourceRoot;
122+
123+
__structuredAttrs = true;
124+
strictDeps = true;
125+
126+
nativeBuildInputs = [
127+
asar
128+
autoPatchelfHook
129+
copyDesktopItems
130+
makeWrapper
131+
];
132+
133+
buildInputs = desktopLibs;
134+
135+
desktopItems = [
136+
(makeDesktopItem {
137+
name = "antigravity-hub";
138+
desktopName = "Antigravity";
139+
comment = "Antigravity 2 - Agent-first development platform";
140+
exec = "antigravity %U";
141+
icon = "antigravity";
142+
terminal = false;
143+
type = "Application";
144+
categories = [ "Development" ];
145+
startupWMClass = "antigravity";
146+
})
147+
];
148+
149+
installPhase = ''
150+
runHook preInstall
151+
mkdir -p $out/share/antigravity
152+
cp -r . $out/share/antigravity/
153+
154+
mkdir -p $out/bin
155+
makeWrapper $out/share/antigravity/antigravity $out/bin/antigravity \
156+
--add-flags "--no-sandbox" \
157+
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
158+
${lib.optionalString (passwordStore != "") "--add-flags --password-store=${passwordStore}"} \
159+
--prefix PATH : ${lib.makeBinPath [ xdg-utils ]} \
160+
--prefix PATH : /nix/store \
161+
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath desktopLibs} \
162+
--prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \
163+
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}"
164+
165+
asar extract-file resources/app.asar icon.png
166+
install -Dm644 icon.png $out/share/icons/hicolor/512x512/apps/antigravity.png
167+
168+
runHook postInstall
169+
'';
170+
171+
passthru.updateScript = ./update.sh;
172+
173+
meta = {
174+
description = "Desktop environment for managing multiple autonomous agents across independent projects.";
175+
homepage = "https://antigravity.google";
176+
changelog = "https://antigravity.google/changelog";
177+
downloadPage = "https://antigravity.google/download";
178+
license = lib.licenses.unfree;
179+
platforms = [
180+
"x86_64-linux"
181+
"aarch64-linux"
182+
];
183+
mainProgram = "antigravity";
184+
maintainers = with lib.maintainers; [
185+
BohdanTkachenko
186+
];
187+
};
188+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "2.0.10",
3+
"sources": {
4+
"x86_64-linux": {
5+
"url": "https://storage.googleapis.com/antigravity-public/antigravity-hub/2.0.10-5119448496078848/linux-x64/Antigravity.tar.gz",
6+
"sha256": "sha256-EtpgukOuoxKItexk2JqrcPYf2yogwMtbYQwg6DtkbjI=",
7+
"sourceRoot": "Antigravity-x64"
8+
},
9+
"aarch64-linux": {
10+
"url": "https://storage.googleapis.com/antigravity-public/antigravity-hub/2.0.10-5119448496078848/linux-arm/Antigravity.tar.gz",
11+
"sha256": "sha256-McB+Omy+loZ503F/oL8n1wr4hoXbR6wS15zhADW2nKs=",
12+
"sourceRoot": "Antigravity-arm64"
13+
}
14+
}
15+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
#!/usr/bin/env nix-shell
2+
#!nix-shell -i bash -p curl jq yq-go nix coreutils cacert
3+
4+
set -euo pipefail
5+
6+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
7+
SOURCE_JSON="$DIR/sources.json"
8+
9+
MANIFEST_BASE_URL="https://antigravity-hub-auto-updater-974169037036.us-central1.run.app/manifest"
10+
DOWNLOAD_BASE_URL="https://storage.googleapis.com/antigravity-public/antigravity-hub"
11+
12+
# Function to fetch and resolve latest release details for a platform
13+
resolve_platform() {
14+
local channel_arch="$1" # e.g., "x64" or "arm64"
15+
16+
local manifest_url="${MANIFEST_BASE_URL}/latest-${channel_arch}-linux.yml"
17+
local yaml_data
18+
if ! yaml_data=$(curl -s --fail "$manifest_url"); then
19+
echo "Error: Failed to fetch manifest from $manifest_url" >&2
20+
exit 1
21+
fi
22+
23+
local ver
24+
ver=$(echo "$yaml_data" | yq '. | .version')
25+
local url
26+
url=$(echo "$yaml_data" | yq '.files[] | select(.url == "https://*") | .url')
27+
local exec_id
28+
exec_id=$(echo "$url" | sed -E 's|.*/[0-9.]+-([0-9]+)/.*|\1|')
29+
30+
if [[ -z "$ver" || -z "$exec_id" ]]; then
31+
echo "Error: Failed to parse version or execution ID from $manifest_url" >&2
32+
exit 1
33+
fi
34+
35+
echo "$ver" "$exec_id"
36+
}
37+
38+
# Function to prefetch and calculate sha256 hash in SRI format
39+
prefetch() {
40+
local url="$1"
41+
42+
echo "Prefetching $url..." >&2
43+
nix store prefetch-file --json "$url" | jq -r .hash
44+
}
45+
46+
# Resolve latest versions and execution IDs for both platforms
47+
echo "Checking latest releases..."
48+
read -r x64_VERSION x64_EXEC_ID < <(resolve_platform "x64")
49+
read -r arm64_VERSION arm64_EXEC_ID < <(resolve_platform "arm64")
50+
51+
# Enforce both platforms are on the same version
52+
if [[ "$x64_VERSION" == "$arm64_VERSION" ]]; then
53+
TARGET_VERSION="$x64_VERSION"
54+
TARGET_EXEC_ID="$x64_EXEC_ID"
55+
else
56+
# Find the lower version to ensure both platforms support this release
57+
TARGET_VERSION=$(echo -e "$x64_VERSION\n$arm64_VERSION" | sort -V | head -n 1)
58+
if [[ "$TARGET_VERSION" == "$x64_VERSION" ]]; then
59+
TARGET_EXEC_ID="$x64_EXEC_ID"
60+
else
61+
TARGET_EXEC_ID="$arm64_EXEC_ID"
62+
fi
63+
echo "Warning: Platform version mismatch detected (x64: $x64_VERSION, arm64: $arm64_VERSION)." >&2
64+
echo "Enforcing same version across platforms by aligning to the lower version: $TARGET_VERSION" >&2
65+
fi
66+
67+
# Construct target GCS URLs
68+
x64_URL="${DOWNLOAD_BASE_URL}/${TARGET_VERSION}-${TARGET_EXEC_ID}/linux-x64/Antigravity.tar.gz"
69+
arm64_URL="${DOWNLOAD_BASE_URL}/${TARGET_VERSION}-${TARGET_EXEC_ID}/linux-arm/Antigravity.tar.gz"
70+
71+
# Check if we actually need to update
72+
if [[ -f "$SOURCE_JSON" ]]; then
73+
CURRENT_VERSION=$(jq -r '.version // empty' "$SOURCE_JSON")
74+
CURRENT_X64_URL=$(jq -r '.sources."x86_64-linux".url // empty' "$SOURCE_JSON")
75+
CURRENT_ARM_URL=$(jq -r '.sources."aarch64-linux".url // empty' "$SOURCE_JSON")
76+
77+
if [[ "$CURRENT_X64_URL" == "$x64_URL" && "$CURRENT_ARM_URL" == "$arm64_URL" ]]; then
78+
echo "Antigravity Hub is already up to date (version: $TARGET_VERSION)"
79+
exit 0
80+
fi
81+
82+
if [[ "$CURRENT_VERSION" == "$TARGET_VERSION" ]]; then
83+
echo "Version is the same ($TARGET_VERSION), but URLs have changed. Updating to fresh URLs..."
84+
fi
85+
fi
86+
87+
echo "Updating Antigravity Hub..."
88+
echo " Target Version: $TARGET_VERSION"
89+
echo " Target Exec ID: $TARGET_EXEC_ID"
90+
echo " x64 URL: $x64_URL"
91+
echo " arm64 URL: $arm64_URL"
92+
93+
# Write new sources.json
94+
jq -n \
95+
--arg ver "$TARGET_VERSION" \
96+
--arg url_x64 "$x64_URL" \
97+
--arg hash_x64 "$(prefetch "$x64_URL")" \
98+
--arg root_x64 "Antigravity-x64" \
99+
--arg url_arm "$arm64_URL" \
100+
--arg hash_arm "$(prefetch "$arm64_URL")" \
101+
--arg root_arm "Antigravity-arm64" \
102+
'{
103+
version: $ver,
104+
sources: {
105+
"x86_64-linux": { url: $url_x64, sha256: $hash_x64, sourceRoot: $root_x64 },
106+
"aarch64-linux": { url: $url_arm, sha256: $hash_arm, sourceRoot: $root_arm }
107+
}
108+
}' > "$SOURCE_JSON"
109+
110+
echo "Successfully updated sources.json to $TARGET_VERSION."

0 commit comments

Comments
 (0)