feat: add flake.nix
Add flake.nix for Nix user.
How to use ?
Use ralph in shell without caring about dependencies.
nix shell github:frankbria/ralph-claude-code # enter shell contains ralph
After that, user can use ralph like:
ralph --help
ralph-setup my-project
ralph-monitor
ralph-import prd.md
pkgs
This flakes install follow pkgs:
pkgs.bash
pkgs.jq
pkgs.git
pkgs.nodejs
pkgs.tmux
pkgs.coreutils
pkgs.gnugrep
pkgs.gnused
Summary by CodeRabbit
-
New Features
- Added Nix flake support for building and packaging the project.
- Introduced command-line tools: ralph, ralph-monitor, ralph-setup, and ralph-import.
-
Chores
- Set up development shell environment with all required dependencies.
✏️ Tip: You can customize this high-level summary in your review settings.
Walkthrough
This PR introduces a new Nix flake file that enables building and packaging "Ralph for Claude Code" across multiple UNIX-like systems. It configures inputs, outputs (packages, apps, development shell), wrapper commands with dependencies, and executable binaries through a standardized flake structure.
Changes
| Cohort / File(s) | Summary |
|---|---|
Nix Flake Configuration flake.nix |
Introduces complete Nix flake defining packages (ralph, ralph-claude-code), apps (ralph, ralph-monitor, ralph-setup, ralph-import), and development shell. Configures stdenv derivation with build/runtime dependencies, installs templates/lib/scripts, wraps binaries with PATH, patches scripts for executable permissions, and provides per-system outputs via flake-utils. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~15 minutes
Poem
🐰 A flake so fine, with outputs galore,
Ralph hops now through Nix, forevermore!
Four apps take flight with a PATH wrapped tight,
The dev shell awaits, a cozy delight! ✨
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title 'feat: add flake.nix' directly and clearly describes the main change: adding a new flake.nix file to the project. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
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 @coderabbitai help to get the list of available commands and usage tips.
Add Nix flake to package and run the ralph CLI commands via packages.default and apps
Introduce flake.nix that builds ralph-claude-code with runtime deps, installs scripts under $out/bin and $out/share/ralph, patches ralph_loop.sh to source from the store, adds apps for nix run, and provides a dev shell.
📍Where to Start
Start with the flake definition in flake.nix, focusing on outputs.packages.ralph-claude-code and the installPhase.
Macroscope summarized 8203555.
Thank you @MSDimos for this Nix flake contribution! 🙏
We're closing this PR for now to do architectural assessment before adding new packaging systems. Key considerations:
- Maintenance synchronization - Keeping flake.nix in sync with install.sh as dependencies evolve
- CI/CD integration - Testing Nix builds in our pipeline
- Documentation - Proper Nix-specific installation guides
We've created issue #157 to track Nix support as a feature request. Your flake.nix will be excellent reference material when we implement this.
Thank you for thinking about the Nix community - we'd love your input on the architectural discussion in the issue!