Skip to content

refactor: manage foundry via nix instead of manual installation - #681

Merged
shunkakinoki merged 1 commit into
mainfrom
refactor/foundry-nix-management
Jan 27, 2026
Merged

refactor: manage foundry via nix instead of manual installation#681
shunkakinoki merged 1 commit into
mainfrom
refactor/foundry-nix-management

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Jan 27, 2026

Copy link
Copy Markdown
Owner

Changes

  • Added foundry input to flake.nix from shazow/foundry.nix
  • Added foundry.overlay to overlays/default.nix
  • Added foundry-bin to home-manager packages
  • Removed manual .foundry/bin PATH references from bash, fish, and zsh configs

Technical Details

Foundry is now managed through Nix instead of manual installation, improving reproducibility and version management across systems.

Testing

  • All configuration files build successfully
  • Foundry tools now available through Nix-managed packages

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

    • Add foundry input to flake.nix and enable overlay.
    • Add foundry-bin to home-manager packages.
    • Remove ~/.foundry/bin PATH entries from bash, fish, and zsh.
  • Dependencies

    • Add foundry.nix and flake-utils inputs; update flake.lock.

Written for commit 40111ac. Summary will update on new commits.

Copilot AI review requested due to automatic review settings January 27, 2026 15:00
@shunkakinoki
shunkakinoki enabled auto-merge (squash) January 27, 2026 15:01
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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

  • Nix Integration for Foundry: The Foundry toolkit is now managed declaratively via Nix, moving away from manual installation. This involves adding foundry.nix as a flake input and integrating its overlay.
  • Home Manager Package Update: The foundry-bin package has been added to the home-manager configuration, ensuring Foundry tools are available through the Nix environment.
  • Shell Configuration Cleanup: Manual PATH references to ~/.foundry/bin have been removed from Bash, Fish, and Zsh configurations, as Foundry is now managed by Nix.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Jan 27, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@coderabbitai

coderabbitai Bot commented Jan 27, 2026

Copy link
Copy Markdown
📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Reorganized Foundry tool integration to use centralized package management instead of individual shell PATH configurations.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

The 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

Cohort / File(s) Summary
Flake Input & Overlay
flake.nix, overlays/default.nix
Added new foundry input pointing to github:shazow/foundry.nix and integrated the overlay as an input dependency.
Package Management
home-manager/packages/default.nix
Added foundry-bin to the primary package list for Nix-managed Foundry binary inclusion.
Shell Configuration Cleanup
home-manager/programs/bash/default.nix, home-manager/programs/fish/default.nix, home-manager/programs/zsh/default.nix
Removed manual $HOME/.foundry/bin PATH prepend entries from bash profile, fish shell init (both loginShellInit and interactiveShellInit), and zsh init sections.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

codex

Poem

🐰 Hops with glee through Nix's embrace,
Foundry now finds its rightful place,
No more manual paths to trace,
The overlay handles the race,
Config cleaner, workflow more base!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: refactoring to manage foundry via Nix instead of manual installation, which aligns with all the changes across flake.nix, home-manager packages, overlays, and shell configs.
Description check ✅ Passed The description is directly related to the changeset, detailing the specific changes made (foundry input, overlay integration, package addition, PATH removal) and explaining the technical rationale for improved reproducibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/foundry-nix-management

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • GLM-4: Entity not found: Issue - Could not find referenced Issue.

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.

@mesa-dot-dev

mesa-dot-dev Bot commented Jan 27, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Refactor: manage foundry via nix instead of manual installation.

What changed?

  • Added foundry input to flake.nix from shazow/foundry.nix
  • Added foundry.overlay to overlays/default.nix
  • Added foundry-bin to home-manager packages
  • Removed manual .foundry/bin PATH references from bash, fish, and zsh configs

Description generated by Mesa. Update settings

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.nix as a flake input and wires its overlay into the global overlay set.
  • Installs foundry-bin via 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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 7 files

@shunkakinoki
shunkakinoki merged commit 2dd0ec1 into main Jan 27, 2026
38 checks passed
@shunkakinoki
shunkakinoki deleted the refactor/foundry-nix-management branch January 27, 2026 16:18
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