Skip to content

Commit 7c926bb

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

5 files changed

Lines changed: 260 additions & 0 deletions

File tree

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: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
{
2+
alsa-lib,
3+
at-spi2-atk,
4+
at-spi2-core,
5+
atk,
6+
autoPatchelfHook,
7+
copyDesktopItems,
8+
cairo,
9+
cups,
10+
dbus,
11+
expat,
12+
fetchurl,
13+
fontconfig,
14+
freetype,
15+
gdk-pixbuf,
16+
glib,
17+
gsettings-desktop-schemas,
18+
gtk3,
19+
lib,
20+
libdrm,
21+
libgbm,
22+
libGL,
23+
libglvnd,
24+
libnotify,
25+
libpulseaudio,
26+
libsecret,
27+
libuuid,
28+
libx11,
29+
libxcb,
30+
libxcomposite,
31+
libxcursor,
32+
libxdamage,
33+
libxext,
34+
libxfixes,
35+
libxi,
36+
libxkbcommon,
37+
libxml2,
38+
libxrandr,
39+
libxrender,
40+
libxshmfence,
41+
libxt,
42+
libxtst,
43+
makeDesktopItem,
44+
makeWrapper,
45+
mesa,
46+
nspr,
47+
nss,
48+
pango,
49+
passwordStore ? "basic",
50+
stdenv,
51+
systemd,
52+
vulkan-loader,
53+
wayland,
54+
xdg-utils,
55+
}:
56+
57+
let
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+
sources = builtins.fromJSON (builtins.readFile ./sources.json);
107+
systemSource =
108+
sources.sources.${stdenv.hostPlatform.system}
109+
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
110+
in
111+
stdenv.mkDerivation {
112+
pname = "antigravity-hub";
113+
version = sources.version;
114+
115+
src = fetchurl {
116+
url = systemSource.url;
117+
hash = systemSource.sha256;
118+
};
119+
120+
sourceRoot = systemSource.sourceRoot;
121+
122+
__structuredAttrs = true;
123+
strictDeps = true;
124+
125+
nativeBuildInputs = [
126+
autoPatchelfHook
127+
copyDesktopItems
128+
makeWrapper
129+
];
130+
131+
buildInputs = desktopLibs;
132+
133+
desktopItems = [
134+
(makeDesktopItem {
135+
name = "antigravity-hub";
136+
desktopName = "Antigravity";
137+
comment = "Antigravity 2 - Agent-first development platform";
138+
exec = "antigravity %U";
139+
icon = "antigravity";
140+
terminal = false;
141+
type = "Application";
142+
categories = [ "Development" ];
143+
startupWMClass = "antigravity";
144+
})
145+
];
146+
147+
installPhase = ''
148+
runHook preInstall
149+
mkdir -p $out/share/antigravity
150+
cp -r . $out/share/antigravity/
151+
152+
mkdir -p $out/bin
153+
makeWrapper $out/share/antigravity/antigravity $out/bin/antigravity \
154+
--add-flags "--no-sandbox" \
155+
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
156+
${lib.optionalString (passwordStore != "") "--add-flags --password-store=${passwordStore}"} \
157+
--prefix PATH : ${lib.makeBinPath [ xdg-utils ]} \
158+
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath desktopLibs} \
159+
--prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \
160+
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}"
161+
162+
mkdir -p $out/share/icons/hicolor/512x512/apps
163+
cp ${./icon.png} $out/share/icons/hicolor/512x512/apps/antigravity.png
164+
165+
runHook postInstall
166+
'';
167+
168+
passthru.updateScript = ./update.sh;
169+
170+
meta = {
171+
description = "Desktop environment for managing multiple autonomous agents across independent projects.";
172+
homepage = "https://antigravity.google";
173+
changelog = "https://antigravity.google/changelog";
174+
downloadPage = "https://antigravity.google/download";
175+
license = lib.licenses.unfree;
176+
platforms = [
177+
"x86_64-linux"
178+
"aarch64-linux"
179+
];
180+
mainProgram = "antigravity";
181+
maintainers = with lib.maintainers; [
182+
BohdanTkachenko
183+
];
184+
};
185+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "2.0.1",
3+
"sources": {
4+
"x86_64-linux": {
5+
"url": "https://storage.googleapis.com/antigravity-public/antigravity-hub/2.0.1-6566078776737792/linux-x64/Antigravity.tar.gz",
6+
"sha256": "sha256-Byfh9WlhttI0eUHyeNppzGwX3jvv6YhSSEjNFnOA6as=",
7+
"sourceRoot": "Antigravity-x64"
8+
},
9+
"aarch64-linux": {
10+
"url": "https://storage.googleapis.com/antigravity-public/antigravity-hub/2.0.1-6566078776737792/linux-arm/Antigravity.tar.gz",
11+
"sha256": "sha256-WvVsyd2pVPNpphBFt9ovNIvLCzUH0nK0wOmqfNYXXZs=",
12+
"sourceRoot": "Antigravity-arm64"
13+
}
14+
}
15+
}
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 coreutils
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+
API_URL="https://antigravity-auto-updater-974169037036.us-central1.run.app/releases"
10+
11+
# Fetch data and find the actual highest version
12+
JSON_DATA=$(curl -s "$API_URL")
13+
NEW_VERSION=$(echo "$JSON_DATA" | jq -r '.[].version' | sort -V | tail -n 1)
14+
NEW_EXEC_ID=$(echo "$JSON_DATA" | jq -r --arg ver "$NEW_VERSION" '.[] | select(.version == $ver) | .execution_id')
15+
16+
# Check if we actually need to update
17+
if [[ -f "$SOURCE_JSON" ]]; then
18+
CURRENT_VERSION=$(jq -r '.version' "$SOURCE_JSON")
19+
if [[ "$CURRENT_VERSION" == "$NEW_VERSION" ]]; then
20+
echo "Antigravity Hub is already up to date ($CURRENT_VERSION)"
21+
exit 0
22+
fi
23+
fi
24+
25+
echo "Updating Antigravity Hub to $NEW_VERSION (exec id $NEW_EXEC_ID)..."
26+
27+
URL_X64="https://storage.googleapis.com/antigravity-public/antigravity-hub/${NEW_VERSION}-${NEW_EXEC_ID}/linux-x64/Antigravity.tar.gz"
28+
URL_ARM="https://storage.googleapis.com/antigravity-public/antigravity-hub/${NEW_VERSION}-${NEW_EXEC_ID}/linux-arm/Antigravity.tar.gz"
29+
30+
echo "Fetching hash for x86_64-linux..."
31+
HASH_X64=$(nix-prefetch-url "$URL_X64")
32+
HASH_X64_SRI=$(nix hash to-sri --type sha256 "$HASH_X64")
33+
34+
echo "Fetching hash for aarch64-linux..."
35+
HASH_ARM=$(nix-prefetch-url "$URL_ARM")
36+
HASH_ARM_SRI=$(nix hash to-sri --type sha256 "$HASH_ARM")
37+
38+
jq -n \
39+
--arg ver "$NEW_VERSION" \
40+
--arg url_x64 "$URL_X64" \
41+
--arg hash_x64 "$HASH_X64_SRI" \
42+
--arg root_x64 "Antigravity-x64" \
43+
--arg url_arm "$URL_ARM" \
44+
--arg hash_arm "$HASH_ARM_SRI" \
45+
--arg root_arm "Antigravity-arm64" \
46+
'{
47+
version: $ver,
48+
sources: {
49+
"x86_64-linux": { url: $url_x64, sha256: $hash_x64, sourceRoot: $root_x64 },
50+
"aarch64-linux": { url: $url_arm, sha256: $hash_arm, sourceRoot: $root_arm }
51+
}
52+
}' > "$SOURCE_JSON"
53+
54+
echo "Successfully updated sources.json to $NEW_VERSION."

0 commit comments

Comments
 (0)