feat(ci): add Nix flake and manual nightly builds#19
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR adds a nightly GitHub Actions workflow for branch-scoped Electron packaging, a Nix flake for development and formatting, and an Electron install script guard that skips binary download when configured. ChangesNightly build automation
Nix dev environment and Electron install guard
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1558bcd. Configure here.
| ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder | ||
| NIGHTLY_VERSION: ${{ needs.preflight.outputs.nightly_version }} | ||
| npm_config_audit: "false" | ||
| npm_config_fund: "false" |
There was a problem hiding this comment.
Missing USE_SYSTEM_FPM arm64
Medium Severity
The nightly build job installs system fpm on the linux-arm64 matrix row but never sets USE_SYSTEM_FPM, unlike the existing release workflow. electron-builder then tends to use its bundled x86 fpm on ARM runners, so Linux arm64 .deb packaging in nightly can fail even after the gem install step.
Reviewed by Cursor Bugbot for commit 1558bcd. Configure here.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/workflows/nightly.yml (1)
20-29: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winConsider adding
timeout-minutesto jobs.Neither
preflightnorbuildspecifies a timeout. Sincebuildspans six platform/arch combinations with native packaging tools (fpm, electron-builder, gem installs), a hang in any leg would consume runner minutes indefinitely withcancel-in-progress: false.♻️ Suggested addition
preflight: name: preflight runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 15build: name: ${{ matrix.label }} runs-on: ${{ matrix.os }} needs: preflight + timeout-minutes: 45Also applies to: 77-134
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/nightly.yml around lines 20 - 29, Add explicit timeout limits to the workflow jobs that currently omit them, especially the preflight and build jobs. Update the job definitions in the nightly workflow so each job has a reasonable timeout-minutes value, using the existing job names and the build matrix job as the main targets. This keeps hung runs from consuming runner minutes indefinitely while preserving the current job structure and outputs.flake.nix (1)
37-46: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDuplicated Linux Electron env-var block between devShell and app.
The three
ELECTRON_SKIP_BINARY_DOWNLOAD/ELECTRON_OVERRIDE_DIST_PATH/npm_config_electron_skip_binary_downloadexports are duplicated verbatim between thedevShells.defaultshellHook andopenstroidDev'stext. Consider factoring into a sharedlet-bound string to keep both in sync going forward.♻️ Example refactor
devShells = forAllSystems (system: let pkgs = pkgsFor system; + linuxElectronEnv = '' + export ELECTRON_SKIP_BINARY_DOWNLOAD=1 + export ELECTRON_OVERRIDE_DIST_PATH="${pkgs.electron}/bin" + export npm_config_electron_skip_binary_download=true + ''; in { default = pkgs.mkShell { ... shellHook = '' export ELECTRON_CACHE="$PWD/.cache/electron" export ELECTRON_BUILDER_CACHE="$PWD/.cache/electron-builder" '' - + pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux '' - export ELECTRON_SKIP_BINARY_DOWNLOAD=1 - export ELECTRON_OVERRIDE_DIST_PATH="${pkgs.electron}/bin" - export npm_config_electron_skip_binary_download=true - ''; + + pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux linuxElectronEnv; }; });Also applies to: 60-68
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@flake.nix` around lines 37 - 46, The Linux Electron environment-variable exports are duplicated between the dev shell hook and the app wrapper text, so factor the shared block into a single let-bound string and reuse it in both places. Update the shellHook in the devShells.default section and the openstroidDev definition to reference the same shared snippet for the ELECTRON_SKIP_BINARY_DOWNLOAD, ELECTRON_OVERRIDE_DIST_PATH, and npm_config_electron_skip_binary_download exports, keeping the Linux-only conditional in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/nightly.yml:
- Around line 48-51: Set persist-credentials to false on both actions/checkout
steps so the GITHUB_TOKEN is not left in the local git config during the job.
Update the checkout invocations in the nightly workflow, including the Checkout
source branch step and the other checkout occurrence referenced by the review,
to explicitly disable credential persistence while keeping the existing ref
behavior intact.
In `@flake.nix`:
- Around line 30-35: The Linux dev shell in flake.nix is pulling in nixpkgs’
rolling electron, which can override the app’s pinned Electron major and create
a runtime version mismatch. Update the Linux package list used by the dev
shell/openstroid-dev wrapper so Electron matches the version pinned in
package.json (37.x), or remove the Electron override entirely; use the electron
identifier in the flake output to locate the change.
---
Nitpick comments:
In @.github/workflows/nightly.yml:
- Around line 20-29: Add explicit timeout limits to the workflow jobs that
currently omit them, especially the preflight and build jobs. Update the job
definitions in the nightly workflow so each job has a reasonable timeout-minutes
value, using the existing job names and the build matrix job as the main
targets. This keeps hung runs from consuming runner minutes indefinitely while
preserving the current job structure and outputs.
In `@flake.nix`:
- Around line 37-46: The Linux Electron environment-variable exports are
duplicated between the dev shell hook and the app wrapper text, so factor the
shared block into a single let-bound string and reuse it in both places. Update
the shellHook in the devShells.default section and the openstroidDev definition
to reference the same shared snippet for the ELECTRON_SKIP_BINARY_DOWNLOAD,
ELECTRON_OVERRIDE_DIST_PATH, and npm_config_electron_skip_binary_download
exports, keeping the Linux-only conditional in one place.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f0aca7e6-84a2-488f-ad93-3d5495f95b73
⛔ Files ignored due to path filters (1)
flake.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
.github/workflows/nightly.ymlflake.nixtools/fix-electron-install.cjs
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>


This PR adds Nix flake support for reproducible development environments and a manually triggered nightly build workflow.
Changes
Run
nix developto enter the dev shell or trigger the nightly workflow from GitHub Actions.Note
Low Risk
CI and local-dev tooling only; no runtime app logic changes beyond optional Electron install behavior when env vars are set.
Overview
Adds Nix (
flake.nix+flake.lock) for reproducible dev on Linux/macOS: default dev shell with bun, Node 22, Linux packaging tools, and on Linux Nix-provided Electron viaELECTRON_SKIP_BINARY_DOWNLOAD/ELECTRON_OVERRIDE_DIST_PATH. Also exposesnix rundev app and an alejandra formatter.tools/fix-electron-install.cjsnow exits early when those skip-download env vars are set, sonpm installdoes not fetch Electron binaries in the Nix shell.New
.github/workflows/nightly.yml: workflow_dispatch on a chosen branch; preflight validates the branch, computesYYYYMMDD.runNumbernightly id andbase-nightly.*version; matrix build on Blacksmith runners for Windows/macOS/Linux x64 and arm64, bumps version withsync-release-version.mjs, builds and packages withelectron-builder(no publish), uploads per-platform artifacts.Reviewed by Cursor Bugbot for commit 1558bcd. Configure here.
Summary by CodeRabbit