Skip to content

fix(nix): use wrapped Electron in dev shell - #1027

Open
bet4it wants to merge 2 commits into
getopenscreen:mainfrom
bet4it:fix/nix-electron-dev-shell
Open

bet4it wants to merge 2 commits into
getopenscreen:mainfrom
bet4it:fix/nix-electron-dev-shell

Conversation

@bet4it

@bet4it bet4it commented Oct 6, 2026 •

Copy link
Copy Markdown

Summary

The Nix dev shell pointed npm's electron package at ${electron}/libexec/electron, the bare Electron binary. vite-plugin-electron launched it without the nixpkgs wrapper's GIO/GTK environment, so npm run dev built but the GUI failed to open on Linux.

  • ELECTRON_OVERRIDE_DIST_PATH now points at ${electron}/bin, the wrapped launcher.
  • ELECTRON_SKIP_BINARY_DOWNLOAD=1 stops npm from downloading its own Electron in the shell.
  • No Darwin branch: the flake only defines Linux systems, and nixpkgs ships bin/electron on Darwin as well.

Related issue

None.

Type of change

  • Bug fix
  • Feature
  • Enhancement
  • Documentation
  • Refactor / maintenance
  • Performance
  • Security

Release impact

  • Patch
  • Minor
  • Major / breaking change
  • No release note needed

Desktop impact

  • Windows
  • macOS
  • Linux
  • Installer / packaging
  • Not platform-specific

Screenshots / video

N/A, dev shell only.

Testing

  • nix flake check --no-build --all-systems passes.
  • With the shell's ELECTRON_OVERRIDE_DIST_PATH, the npm electron module resolves to electron-43.4.1/bin/electron, the bash wrapper, with or without path.txt. The old value resolved to the unwrapped ELF. The wrapper runs: --version prints v43.4.1.
  • Ran npm run dev from nix develop; the Electron main process started and registered the global shortcut.

Summary by CodeRabbit

  • Chores
    • The development shell now uses the Electron launcher provided by the development environment and continues to skip automatic Electron binary downloads. This affects development setup only and does not change app features or behavior for end users.

@bet4it
bet4it requested a review from EtienneLescot as a code owner October 6, 2026 00:49
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 611088e9-2f83-41c4-b1ab-91cf9732d6bd


📥 Commits

Reviewing files that changed from the base of the PR and between 87e05c2 and d879ff2.



📒 Files selected for processing (1)
  • flake.nix


Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

The dev shell skips Electron binary downloads and sets ELECTRON_OVERRIDE_DIST_PATH to ${electron}/bin. Updated comments describe the launcher and the absence of path.txt.

Changes

Dev shell Electron configuration

Layer / File(s) Summary
Configure Electron distribution path
flake.nix
The dev shell sets ELECTRON_SKIP_BINARY_DOWNLOAD to "1" and points ELECTRON_OVERRIDE_DIST_PATH at ${electron}/bin. Comments describe the wrapped launcher and the missing path.txt when downloads are skipped.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Bug fix



Merge Risk: ⚪ Minimal · up to d879f

The dev shell points npm’s Electron package to the Nixpkgs launcher, so the reported GUI-startup failure is not present. No actionable merge risk remains.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 87e05

The change uses the existing Nix-provided Electron package through its launcher and disables a separate npm binary download. The reviewed changes are confined to the development shell, with no added privileges, secret access, or production deployment changes identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The direct exposure change is limited to Electron installation and launch behavior within this development shell. The inspected change does not expand service, tenant, data-store, or production deployment authority.

Trust Boundaries and Controls

  • observed — The configuration explicitly requests skipping npm’s Electron binary download while retaining the already-selected Nixpkgs Electron dependency. This is a development-shell binary-source policy, not evidence that npm install scripts are generally disabled or that Electron’s sandbox guarantees have changed.



Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the Nix-related Electron launcher fix and matches the main change.
Description check Passed The description includes all required sections, explains the Linux development-shell bug, documents the configuration changes, and provides testing results.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR



  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The flake only defines Linux systems, so the Darwin branch never evaluated. It was also wrong with the download skipped: without path.txt the npm package resolves Applications/electron, which does not exist. nixpkgs ships bin/electron on Darwin too.
@EtienneLescot

Copy link
Copy Markdown
Collaborator

Thanks! Pushed a small follow-up: dropped the Darwin branch. The flake only builds Linux, and without path.txt it would have resolved Applications/electron. Verified in nix: npm electron now resolves to the wrapped bin/electron.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants