feat: add Nix flake dev environment#29
Conversation
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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds Nix flake support for NixOS users. A new ChangesNix development environment
Estimated code review effort: 2 (Simple) | ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
flake.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
.envrc.gitignoreREADME.mdflake.nix
ELECTRON_OVERRIDE_DIST_PATH → ELECTRON_EXEC_PATH to match flake.nix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Added a small quality-of-life feature to the dev shell: audio streams from the app are now tagged with Why tag at the source? All Electron apps look identical to PipeWire ( To benefit from it on NixOS, pair the tag with a WirePlumber role-based linking policy. Sample configuration: services.pipewire.wireplumber.configPackages = [
(pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/50-ducking.conf" ''
wireplumber.profiles = {
main = {
policy.linking.role-based.loopbacks = required
}
}
wireplumber.settings = {
node.stream.default-media-role = Multimedia
linking.role-based.duck-level = 0.15
}
wireplumber.components.rules = [
{
matches = [
{
provides = "~loopback.sink.*"
}
]
actions = {
merge = {
arguments = {
capture.props = {
policy.role-based.target = true
audio.position = [ FL, FR ]
media.class = Audio/Sink
}
playback.props = {
node.passive = true
media.role = Loopback
}
}
requires = [ support.export-core, pw.node-factory.adapter ]
}
}
}
]
wireplumber.components = [
{
type = virtual, provides = policy.linking.role-based.loopbacks
requires = [ loopback.sink.role.multimedia
loopback.sink.role.assistant ]
}
{
name = libpipewire-module-loopback, type = pw-module
arguments = {
node.name = "loopback.sink.role.multimedia"
node.description = "Multimedia"
capture.props = {
device.intended-roles = [ "Music", "Movie", "Game", "Multimedia" ]
policy.role-based.priority = 10
policy.role-based.action.same-priority = "mix"
policy.role-based.action.lower-priority = "mix"
}
}
provides = loopback.sink.role.multimedia
}
{
name = libpipewire-module-loopback, type = pw-module
arguments = {
node.name = "loopback.sink.role.assistant"
node.description = "Assistant"
capture.props = {
device.intended-roles = [ "Assistant" ]
policy.role-based.priority = 50
policy.role-based.action.same-priority = "mix"
policy.role-based.action.lower-priority = "duck"
}
}
provides = loopback.sink.role.assistant
}
]
'')
];With this in place, regular streams (untagged, defaulting to Multimedia) route through the Multimedia sink, the VTuber's Assistant-role streams route through the Assistant sink, and WirePlumber ducks Multimedia to 15% volume whenever the VTuber speaks. The custom The tag is harmless on non-PipeWire/PulseAudio setups — it is only read by libpulse clients. |
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_PATHso electron-vite picks up the system Electron instead of the one fromnode_modules— noLD_LIBRARY_PATHhacks needed.Includes a
.envrcfor direnv users: rundirenv allowonce and the environment loads automatically every time youcdinto the project.For non-NixOS users
This changes nothing. The flake and
.envrcare inert unless you have Nix installed. The regularnpm install && npm run devworkflow is unchanged.🤖 Generated with Claude Code
Summary by CodeRabbit
nix developworkflow, plus updated Electron environment notes.