Skip to content

build: make rfdtool installable from the flake in other repositories - #2

Merged
darwin67 merged 1 commit into
mainfrom
flake-binary
Oct 21, 2026
Merged

darwin67 merged 1 commit into
mainfrom
flake-binary

Conversation

@darwin67

Copy link
Copy Markdown
Member

Lets RFD repositories install rfdtool as a binary from this flake, pinned by their flake.lock.

What changes

  • Consumable outputs: packages.${system}.default (also .rfdtool) and a new overlays.default that adds pkgs.rfdtool. Both come from one mkRfdtool pkgs definition, so with inputs.nixpkgs.follows rfdtool builds against the consumer's nixpkgs and its go_1_26.
  • rfdtool --version: Nix builds report the commit they came from (-X main.version, stripped with -s -w); go install builds report the module version from build info.
  • apps.default removed: nix run github:chaba-dev/rfdtool uses the package's meta.mainProgram.
  • README: a flake-input example for an RFD repository's dev shell (with git, which check --base-ref and new call), the overlay alternative, and supported platforms (Linux and Apple Silicon; current nixpkgs dropped Intel Macs).

Verification

  • nix build → result/bin/rfdtool is the only binary; rfdtool --version prints the commit. The build log shows ok github.com/chaba-dev/rfdtool/internal/rfd, so nix flake check still runs the tests.
  • A scratch consumer flake with rfdtool.inputs.nixpkgs.follows = "nixpkgs" built dev shells both from rfdtool.packages.${system}.default and from the overlay; in each, rfdtool check passed on the Renga RFDs.
  • nix flake check, gofmt, and golangci-lint pass.

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>
@darwin67
darwin67 merged commit f95974a into main Oct 21, 2026
3 checks passed
@darwin67
darwin67 deleted the flake-binary branch October 21, 2026 07:23
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.

1 participant