|
| 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 | +} |
0 commit comments