Repository navigation
build: make rfdtool installable from the flake in other repositories - #2
Merged
Merged
Conversation
RFD repositories can now take rfdtool as a flake input and put the
binary in their dev shell, through packages.${system}.default (or
.rfdtool) or overlays.default, which adds pkgs.rfdtool. Both build from
one definition with the consumer's nixpkgs when it follows theirs, using
its go_1_26.
The binary is stripped and reports the commit it was built from with
rfdtool --version; go install builds report the module version instead.
apps.default is gone: nix run uses the package's meta.mainProgram.
The README shows the flake input, with git beside rfdtool for check
--base-ref and new.
Amp-Thread-ID: https://ampcode.com/threads/T-01a15d15-bb12-7429-9794-374e145cd95e
Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets RFD repositories install
rfdtoolas a binary from this flake, pinned by theirflake.lock.What changes
packages.${system}.default(also.rfdtool) and a newoverlays.defaultthat addspkgs.rfdtool. Both come from onemkRfdtool pkgsdefinition, so withinputs.nixpkgs.followsrfdtool builds against the consumer's nixpkgs and itsgo_1_26.rfdtool --version: Nix builds report the commit they came from (-X main.version, stripped with-s -w);go installbuilds report the module version from build info.apps.defaultremoved:nix run github:chaba-dev/rfdtooluses the package'smeta.mainProgram.git, whichcheck --base-refandnewcall), the overlay alternative, and supported platforms (Linux and Apple Silicon; current nixpkgs dropped Intel Macs).Verification
nix build→result/bin/rfdtoolis the only binary;rfdtool --versionprints the commit. The build log showsok github.com/chaba-dev/rfdtool/internal/rfd, sonix flake checkstill runs the tests.rfdtool.inputs.nixpkgs.follows = "nixpkgs"built dev shells both fromrfdtool.packages.${system}.defaultand from the overlay; in each,rfdtool checkpassed on the Renga RFDs.nix flake check,gofmt, and golangci-lint pass.