refactor: manage foundry via nix instead of manual installation - #681
Conversation
Summary of ChangesHello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the management of the Foundry development toolkit by integrating it into the Nix ecosystem. The primary goal is to enhance reproducibility and streamline version management across different systems by leveraging Nix's declarative package management capabilities. This change ensures that Foundry tools are consistently available and correctly configured without manual intervention in shell environments. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughThe PR transitions Foundry dependency management from manual PATH configuration to a Nix-managed approach by adding a Foundry flake input with overlay integration while removing explicit PATH directory additions from shell initialization files. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
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 |
Mesa DescriptionTL;DRRefactor: manage foundry via nix instead of manual installation. What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request is a great improvement, refactoring the management of Foundry to use Nix. This enhances reproducibility and simplifies dependency management. The changes are clear and correctly implemented across the flake inputs, overlays, and package lists. The removal of manual PATH configurations in the shell startup files is also done correctly. I have one suggestion regarding code duplication in the fish shell configuration that this change has brought to light.
| fish_add_path -p ~/.local/bin | ||
| fish_add_path -p ~/.bun/bin | ||
| fish_add_path -p ~/.cargo/bin | ||
| fish_add_path -p ~/.foundry/bin |
There was a problem hiding this comment.
This line is also removed on line 59, which suggests there is duplicated code for setting up the PATH in this file. While this PR correctly removes the manual foundry path from both locations, consider refactoring to eliminate this code duplication for better maintainability. For example, you could define the paths in a let block and reuse them.
There was a problem hiding this comment.
Pull request overview
Refactors the configuration to manage Foundry via Nix (flake input + overlay + HM package) instead of relying on a manually installed $HOME/.foundry/bin setup, improving reproducibility across machines.
Changes:
- Adds
shazow/foundry.nixas a flake input and wires its overlay into the global overlay set. - Installs
foundry-binvia Home Manager packages. - Removes manual Foundry PATH injections from bash, fish, and zsh configs.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
flake.nix |
Adds the foundry flake input so Foundry can be sourced via Nix. |
flake.lock |
Pins foundry.nix (and its flake-utils dependency) for reproducible builds. |
overlays/default.nix |
Adds the Foundry overlay so pkgs.foundry-* packages are available. |
home-manager/packages/default.nix |
Installs foundry-bin through HM packages instead of manual install. |
home-manager/programs/bash/default.nix |
Removes $HOME/.foundry/bin PATH entry (no longer needed). |
home-manager/programs/fish/default.nix |
Removes ~/.foundry/bin from fish path setup (both init blocks). |
home-manager/programs/zsh/default.nix |
Removes $HOME/.foundry/bin PATH entry (no longer needed). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes
Technical Details
Foundry is now managed through Nix instead of manual installation, improving reproducibility and version management across systems.
Testing
Generated with opencode by glm-4.7
Summary by cubic
Switches Foundry tooling to Nix (via shazow/foundry.nix), replacing manual installs. Improves reproducibility and version pinning, and removes custom PATH hacks.
Refactors
Dependencies
Written for commit 40111ac. Summary will update on new commits.