Skip to content

Commit 6ac775d

Browse files
antigravity-hub: init at 2.0.1
Assisted-by: Antigravity (Gemini 3.1 Pro (High))
1 parent e00d35b commit 6ac775d

5 files changed

Lines changed: 248 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/home/dan/.gemini/config/projects/2019eb0e-f78d-4acf-b329-37bb826dd82c.json

maintainers/maintainer-list.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3713,6 +3713,12 @@
37133713
github = "bohanubis";
37143714
githubId = 77834479;
37153715
};
3716+
BohdanTkachenko = {
3717+
email = "bohdan@tkachenko.dev";
3718+
github = "BohdanTkachenko";
3719+
githubId = 929598;
3720+
name = "Bohdan Tkachenko";
3721+
};
37163722
bohreromir = {
37173723
github = "bohreromir";
37183724
githubId = 40412303;
76.8 KB
Loading
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
{
2+
alsa-lib,
3+
at-spi2-atk,
4+
at-spi2-core,
5+
atk,
6+
autoPatchelfHook,
7+
cairo,
8+
cups,
9+
dbus,
10+
expat,
11+
fetchurl,
12+
fontconfig,
13+
freetype,
14+
gdk-pixbuf,
15+
glib,
16+
gsettings-desktop-schemas,
17+
gtk3,
18+
lib,
19+
libdrm,
20+
libgbm,
21+
libGL,
22+
libglvnd,
23+
libnotify,
24+
libpulseaudio,
25+
libsecret,
26+
libuuid,
27+
libx11,
28+
libxcb,
29+
libxcomposite,
30+
libxcursor,
31+
libxdamage,
32+
libxext,
33+
libxfixes,
34+
libxi,
35+
libxkbcommon,
36+
libxml2,
37+
libxrandr,
38+
libxrender,
39+
libxshmfence,
40+
libxt,
41+
libxtst,
42+
makeWrapper,
43+
mesa,
44+
nspr,
45+
nss,
46+
pango,
47+
passwordStore ? "basic",
48+
stdenv,
49+
systemd,
50+
vulkan-loader,
51+
wayland,
52+
xdg-utils,
53+
}:
54+
55+
let
56+
inherit (stdenv) hostPlatform;
57+
58+
desktopLibs = [
59+
alsa-lib
60+
at-spi2-atk
61+
at-spi2-core
62+
atk
63+
cairo
64+
cups
65+
dbus
66+
expat
67+
fontconfig
68+
freetype
69+
gdk-pixbuf
70+
glib
71+
gsettings-desktop-schemas
72+
gtk3
73+
libdrm
74+
libgbm
75+
libGL
76+
libglvnd
77+
libnotify
78+
libpulseaudio
79+
libsecret
80+
libuuid
81+
libx11
82+
libxcb
83+
libxcomposite
84+
libxcursor
85+
libxdamage
86+
libxext
87+
libxfixes
88+
libxi
89+
libxkbcommon
90+
libxml2
91+
libxrandr
92+
libxrender
93+
libxshmfence
94+
libxt
95+
libxtst
96+
mesa
97+
nspr
98+
nss
99+
pango
100+
stdenv.cc.cc
101+
systemd
102+
vulkan-loader
103+
wayland
104+
];
105+
106+
desktopSrcs = {
107+
x86_64-linux = {
108+
url = "https://storage.googleapis.com/antigravity-public/antigravity-hub/2.0.1-6566078776737792/linux-x64/Antigravity.tar.gz";
109+
hash = "sha256-Byfh9WlhttI0eUHyeNppzGwX3jvv6YhSSEjNFnOA6as=";
110+
sourceRoot = "Antigravity-x64";
111+
};
112+
aarch64-linux = {
113+
url = "https://storage.googleapis.com/antigravity-public/antigravity-hub/2.0.1-6566078776737792/linux-arm/Antigravity.tar.gz";
114+
hash = "sha256-WvVsyd2pVPNpphBFt9ovNIvLCzUH0nK0wOmqfNYXXZs=";
115+
sourceRoot = "Antigravity-arm64";
116+
};
117+
};
118+
119+
source =
120+
desktopSrcs.${hostPlatform.system}
121+
or (throw "antigravity-hub: unsupported system ${hostPlatform.system}");
122+
in
123+
stdenv.mkDerivation {
124+
pname = "antigravity-hub";
125+
version = "2.0.1";
126+
127+
src = fetchurl {
128+
inherit (source) url hash;
129+
};
130+
131+
sourceRoot = source.sourceRoot;
132+
133+
nativeBuildInputs = [
134+
autoPatchelfHook
135+
makeWrapper
136+
];
137+
138+
buildInputs = desktopLibs;
139+
140+
installPhase = ''
141+
runHook preInstall
142+
mkdir -p $out/share/antigravity
143+
cp -r . $out/share/antigravity/
144+
145+
mkdir -p $out/bin
146+
makeWrapper $out/share/antigravity/antigravity $out/bin/antigravity \
147+
--add-flags "--no-sandbox" \
148+
${lib.optionalString (passwordStore != "") "--add-flags \"--password-store=${passwordStore}\""} \
149+
--prefix PATH : ${lib.makeBinPath [ xdg-utils ]} \
150+
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath desktopLibs} \
151+
--prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \
152+
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}"
153+
154+
mkdir -p $out/share/icons/hicolor/512x512/apps
155+
cp ${./icon.png} $out/share/icons/hicolor/512x512/apps/antigravity.png
156+
157+
mkdir -p $out/share/applications
158+
cat > $out/share/applications/antigravity-hub.desktop << EOF
159+
[Desktop Entry]
160+
Name=Antigravity
161+
Comment=Antigravity 2 - Agent-first development platform
162+
Exec=$out/bin/antigravity %U
163+
Icon=antigravity
164+
Terminal=false
165+
Type=Application
166+
Categories=Development;
167+
StartupWMClass=Antigravity
168+
EOF
169+
runHook postInstall
170+
'';
171+
172+
passthru.updateScript = ./update.sh;
173+
174+
meta = {
175+
description = "A standalone orchestrator for managing autonomous AI agents, designed to handle parallel workflows and independent projects outside of a traditional code editor.";
176+
homepage = "https://antigravity.google";
177+
license = lib.licenses.unfree;
178+
platforms = [
179+
"x86_64-linux"
180+
"aarch64-linux"
181+
];
182+
mainProgram = "antigravity";
183+
maintainers = with lib.maintainers; [
184+
BohdanTkachenko
185+
];
186+
};
187+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env nix-shell
2+
#!nix-shell -i bash -p curl jq nix
3+
4+
set -euo pipefail
5+
6+
# Fetch latest release
7+
LATEST_RELEASE=$(curl -s "https://antigravity-auto-updater-974169037036.us-central1.run.app/releases" | jq -r '.[0]')
8+
NEW_VERSION=$(echo "$LATEST_RELEASE" | jq -r '.version')
9+
NEW_EXEC_ID=$(echo "$LATEST_RELEASE" | jq -r '.execution_id')
10+
11+
# Find current version
12+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
13+
PACKAGE_NIX="$DIR/package.nix"
14+
CURRENT_VERSION=$(grep -oP 'version = "\K[^"]+' "$PACKAGE_NIX" | head -n1)
15+
16+
if [[ "$CURRENT_VERSION" == "$NEW_VERSION" ]]; then
17+
echo "Antigravity Hub is already up to date ($CURRENT_VERSION)"
18+
exit 0
19+
fi
20+
21+
echo "Updating Antigravity Hub from $CURRENT_VERSION to $NEW_VERSION (exec id $NEW_EXEC_ID)..."
22+
23+
URL_X64="https://storage.googleapis.com/antigravity-public/antigravity-hub/${NEW_VERSION}-${NEW_EXEC_ID}/linux-x64/Antigravity.tar.gz"
24+
URL_ARM="https://storage.googleapis.com/antigravity-public/antigravity-hub/${NEW_VERSION}-${NEW_EXEC_ID}/linux-arm/Antigravity.tar.gz"
25+
26+
echo "Fetching hash for x86_64-linux..."
27+
HASH_X64=$(nix-prefetch-url "$URL_X64")
28+
HASH_X64_SRI=$(nix hash to-sri --type sha256 "$HASH_X64")
29+
30+
echo "Fetching hash for aarch64-linux..."
31+
HASH_ARM=$(nix-prefetch-url "$URL_ARM")
32+
HASH_ARM_SRI=$(nix hash to-sri --type sha256 "$HASH_ARM")
33+
34+
# Extract current hashes
35+
CURRENT_HASH_X64=$(grep -B1 'sourceRoot = "Antigravity-x64"' "$PACKAGE_NIX" | grep 'hash =' | grep -oP 'hash = "\K[^"]+')
36+
CURRENT_HASH_ARM=$(grep -B1 'sourceRoot = "Antigravity-arm64"' "$PACKAGE_NIX" | grep 'hash =' | grep -oP 'hash = "\K[^"]+')
37+
38+
# Replace version
39+
sed -i "s/version = \"$CURRENT_VERSION\"/version = \"$NEW_VERSION\"/" "$PACKAGE_NIX"
40+
41+
# Replace urls
42+
sed -i -E "s|https://storage\.googleapis\.com/antigravity-public/antigravity-hub/[^/]+/linux-x64/Antigravity\.tar\.gz|$URL_X64|" "$PACKAGE_NIX"
43+
sed -i -E "s|https://storage\.googleapis\.com/antigravity-public/antigravity-hub/[^/]+/linux-arm/Antigravity\.tar\.gz|$URL_ARM|" "$PACKAGE_NIX"
44+
45+
# Replace hashes
46+
if [[ -n "$CURRENT_HASH_X64" ]]; then
47+
sed -i "s|$CURRENT_HASH_X64|$HASH_X64_SRI|" "$PACKAGE_NIX"
48+
fi
49+
50+
if [[ -n "$CURRENT_HASH_ARM" ]]; then
51+
sed -i "s|$CURRENT_HASH_ARM|$HASH_ARM_SRI|" "$PACKAGE_NIX"
52+
fi
53+
54+
echo "Successfully updated to $NEW_VERSION."

0 commit comments

Comments
 (0)