Skip to content

feat: add Nix flake dev environment#29

Open
yuuhikaze wants to merge 2 commits into
Open-LLM-VTuber:mainfrom
yuuhikaze:feat/nix-flake-dev
Open

feat: add Nix flake dev environment#29
yuuhikaze wants to merge 2 commits into
Open-LLM-VTuber:mainfrom
yuuhikaze:feat/nix-flake-dev

Conversation

@yuuhikaze

@yuuhikaze yuuhikaze commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Adds a Nix flake for a reproducible development environment, mainly aimed at NixOS users who can't run the npm-bundled Electron binary out of the box (missing dynamic libraries, no hardcoded RPATHs).

What it does

The flake provides a dev shell with Node.js and a NixOS-patched Electron binary. It sets ELECTRON_EXEC_PATH so electron-vite picks up the system Electron instead of the one from node_modules — no LD_LIBRARY_PATH hacks needed.

Includes a .envrc for direnv users: run direnv allow once and the environment loads automatically every time you cd into the project.

For non-NixOS users

This changes nothing. The flake and .envrc are inert unless you have Nix installed. The regular npm install && npm run dev workflow is unchanged.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a Nix flake–based development environment, providing a ready-to-use shell with Node.js and Electron (recommended for NixOS users).
  • Documentation
    • Expanded the README with NixOS-focused setup instructions, including a direnv/nix-direnv workflow and a manual nix develop alternative.
  • Chores
    • Updated project environment and ignore settings to improve flake/direnv usability and ignore local editor/cache files.

Add Nix flake with NixOS-patched Electron binary and direnv
integration for reproducible development setup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 50337665-ac94-4a5d-a4b5-65a4b49b80d9

📥 Commits

Reviewing files that changed from the base of the PR and between 6b4a133 and f9ebaa0.

📒 Files selected for processing (1)
  • README.md
✅ Files skipped from review due to trivial changes (1)
  • README.md

📝 Walkthrough

Walkthrough

Adds Nix flake support for NixOS users. A new flake.nix defines a dev shell with nodejs and electron, setting ELECTRON_EXEC_PATH to the Nix-provided binary. .envrc activates the flake via direnv, .gitignore excludes .cursorrules and .direnv, and README.md documents the Nix setup workflow.

Changes

Nix Flake Development Environment

Layer / File(s) Summary
Flake definition and direnv integration
flake.nix, .envrc, .gitignore
flake.nix defines a default devShell for x86_64-linux and aarch64-linux with nodejs and electron, setting ELECTRON_EXEC_PATH to the Nix electron binary. .envrc adds use flake . to activate via direnv. .gitignore excludes .cursorrules and .direnv.
NixOS setup documentation
README.md
Adds a "Using Nix" subsection to Project Setup covering direnv/nix-direnv activation, manual nix develop workflow, and documentation that ELECTRON_EXEC_PATH from the flake eliminates the need for LD_LIBRARY_PATH exports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 A flake upon the shelf today,
Nix shells for those on NixOS way.
use flake . — direnv agrees,
Electron found with greatest ease.
No LD_LIBRARY_PATH to fuss,
The rabbit hops without a fuss! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add Nix flake dev environment' accurately captures the main change: adding a Nix flake configuration for a development environment, which is the core of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 `@README.md`:
- Around line 11-30: The README.md documentation at line 29 references an
incorrect environment variable name `ELECTRON_OVERRIDE_DIST_PATH`, but the
actual flake.nix implementation sets `ELECTRON_EXEC_PATH`. Update the README.md
to replace the environment variable reference from `ELECTRON_OVERRIDE_DIST_PATH`
to `ELECTRON_EXEC_PATH` to match the actual implementation and keep the
documentation accurate with how electron-vite reads this variable.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 90127b66-ddde-4cd9-8d01-98380da145e4

📥 Commits

Reviewing files that changed from the base of the PR and between d176e7d and 6b4a133.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .envrc
  • .gitignore
  • README.md
  • flake.nix

Comment thread README.md
ELECTRON_OVERRIDE_DIST_PATH → ELECTRON_EXEC_PATH to match flake.nix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant