Copy library / What got built / Grok Bot
Packaging the Grok Bot desktop app for Linux with Nix
# 用 Nix 把 Grok Bot 桌面应用打包到 Linux Source: https://github.com/portal-wheatley/Grok-Bot-for-Linux/pull/1 Author: portal-wheatley 这个 PR 用 Nix flake 把 Grok Bot 桌面应用打包到 x86_64 和 aarch64 Linux:下载官方 Windows 安装包并解包,在 nixpkgs 的 Electron 42 上运行,删掉 Windows 原生插件,重新编译 tree-sitter。作者在 x86_64 的 Xvfb 下测试到登录页能渲染、登录链接能打开,但未在登录状态下测试;aarch64 尚未在真机运行。
- What it does
- This PR packages the Grok Bot desktop app for x86_64 and aarch64 Linux as a Nix flake: it downloads the official Windows installer, unpacks it, runs it on Electron 42 from nixpkgs, drops the Windows native addons and rebuilds tree-sitter. On x86_64 under Xvfb the sign-in screen renders and the sign-in link opens, but it was not tested while signed in; aarch64 has not been run on hardware yet.
- Scenarios
- Watch PRs / repos Code & ship
- What the source covers
- Author & original linkYes
- What it doesYes
- Verbatim source excerptYes
- Screenshots / mediaNot in source
- Steps / chaptersYes
- Verbatim prompt / configNot in source
- Results / numbersNot in source
- Risk notesYes
- Related entriesYes
— means the source doesn't say; we don't fill it in.
- Verbatim source excerpt
Package Grok Bot for Linux (x86_64 and aarch64) with Nix
Packages the Grok Bot desktop app for Linux as a Nix flake, for x86_64 and aarch64.
## How it works
- Downloads the official Windows installer (version and hash pinned in `sources.json`), unpacks it with 7-Zip, and unpacks `app.asar` into a plain `resources/app` directory.
- Runs it on the matching Electron from nixpkgs (`electron_42-bin`, upstream ships 42.11.16). The binary is copied as `grok-bot` so `app.isPackaged` is true.
- Deletes all Windows native addons. The app loads each one behind a `try`/`catch` and turns the featureShow full post
off.
- Rebuilds `tree-sitter` and `tree-sitter-bash` from npm sources, because the local exec daemon needs them at load time and npm has no linux-arm64 prebuilds.
- Leaves out `cursor-proclist` on purpose: it only feeds process-usage telemetry.
- `update.sh` refreshes `sources.json` from Cursor's update service. The build fails if upstream moves to a different Electron major.
The flake allows only `grok-bot` (unfree) and Electron 42 (marked insecure by nixpkgs), so `nix run` works as is.
## Tested
- x86_64 under Xvfb: the sign-in screen renders, **Sign in** opens `cursor.com/loginDeepControl…` through `xdg-open`, a second launch with a `grokbot://` link hands off to the running instance and exits, and both tree-sitter addons load and parse inside Electron 42's runtime. Not tested while signed in.
- aarch64: the flake evaluates. An aarch64 build only compiles the two small addons, and everything else comes from cache or is downloaded. Both addons cross-compile to aarch64 ELF. **Not yet run on aarch64 hardware.**
Try it before merging:
```
nix run github:portal-wheatley/Grok-Bot-for-Linux/initial-port
```
Approach credit: [jakob-bu/grok-bot-linux-unofficial](https://github.com/jakob-bu/grok-bot-linux-unofficial).
🤖 Generated with [Clauportal-wheatley · · Open original ↗ From the project README, verbatim and untranslated.
- Steps / points from the source
- Unfree: Grok Bot is proprietary. The package is marked that way.
- Insecure: Grok Bot 0.79.4 is built for Electron 42. nixpkgs marks
- Download the official Windows installer from Cursor's CDN. Its version
- Unpack it with 7-Zip and unpack the app archive (app.asar) into a plain
- Delete every Windows native addon (.node, .exe, .dll).
- Rebuild the two addons the app cannot run without, tree-sitter and
- Put the app next to the matching Electron from nixpkgs (electron_42-bin).
- Wrap it with xdg-open on the PATH (for sign-in) and the usual Wayland
Verbatim from the source, untranslated.
- Prompt
The source does not include a prompt you can copy verbatim.
- How to copy
- Open the repo: github.com/portal-wheatley/Grok-Bot-for-Linux/pull/1 ↗
- Read the README, send the repo link to your Bot and have it reproduce it
- Get it working small first, then add a routine
- Risks and limits
- Deletes, unsubscribes or cancels things: get a list first and confirm each item
- Uses a browser or website login: the costliest kind of step, so prefer a connector where one exists
- The author's result may not reproduce for you; the original post is the reference
- Usage estimate
- Estimate with the metal calculator