-
Notifications
You must be signed in to change notification settings - Fork 808
[nix] Extract Go derivation to nested flake for cross-repo reuse #4406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Exposing the go derivation via a flake allows the firewood flake to use it to provide its go version without preventing the avalanchego flake from depending on the firewood flake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors Go derivation into a nested flake structure to enable cross-repository reuse while maintaining dependency relationships between avalanchego and firewood projects.
- Extracts Go toolchain definition from nix/go.nix into a standalone flake (nix/go/flake.nix)
- Updates main flake to consume Go package from nested flake instead of direct import
- Updates documentation reference to reflect new file location
Reviewed Changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.
File | Description |
---|---|
nix/go/flake.nix | Creates new standalone flake exporting Go toolchain package |
flake.nix | Updates to use go-flake input instead of direct import |
go.mod | Updates comment to reference new Go derivation file location |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
1fc5ebf
to
335c4d2
Compare
Just to confirm I understand the issue correctly; before this change, did the firewood flake need to depend on the entire avalanchego flake just to get the Go version, which would create a circular dependency since avalanchego also depends on firewood? And this PR solves it by letting firewood import only the Go derivation from nix/go instead of the full avalanchego flake - is that right? |
Correct. And I'd like to reuse avalancheg's go derivation in the firewood flake instead of:
|
Why this should be merged
Exposing the go derivation via a flake allows the firewood flake to use it to provide its go version without preventing the avalanchego flake from depending on the firewood flake.
How this was tested
nix ./nix/go
nix run 'github:ava-labs/avalanchego?dir=nix/go&ref=9cd1c3aee7c2ef1b46621799d7ef0698c2326046'
Need to be documented in RELEASES.md?
N/A