Make flakybin the nix reference repository #1

Merged
mikluko merged 5 commits from nix-reference into main 2026-11-25 21:37:25 +00:00
Owner

Summary

flakybin becomes the reference repository: changelog on fragments, Go tests and build in the nix sandbox, a nix flake, every job on the nixos runner.

-Makefile, .ko.yaml               # ko + helm by hand, to ghcr.io
+flake.nix                        # package, image-amd64/arm64, checks.test (-race), checks.lint, devShell
+VERSION                          # the flake's version; the release commit writes it
+Taskfile.yaml, .golangci.yaml
+CHANGELOG.md, .changelog/        # fragments; the release folds them
+.forgejo/workflows/
+  ci.yaml       # PR, and called by release: nix flake check, nix build, helm lint; changelog validate on PR
+  release.yaml  # dispatch: prepare -> ci -> publish -> tag
+.github/workflows/mirror.yaml    # GitHub mirrors sarak.sh
 go.mod: github.com/mikluko/flakybin -> sarak.sh/mikluko/flakybin
release.yaml (workflow_dispatch, prerelease: bool)
  prepare  final: release@v2 folds the fragments, VERSION=X, commit, push main
           prerelease: release@v2 prerelease -> X-pre.N, main untouched
           a dated entry no tag names (a failed run): neither, release that commit
  ci       on that commit
  publish  VERSION written and staged, nix build images, crane push, helm push
  tag      POST /releases at that commit: the tag appears last

The tests run in the sandbox, which has a loopback of its own: the runner itself denies loopback to jobs, and httptest.NewServer in crawl_test.go and log_test.go needs it.

Evidence

  • Before: no CI; golangci-lint 21 findings.
    After: nix flake check and nix build of the package and both images pass on the runner (this PR's CI); helm lint --strict ok. The release path runs first on the first dispatch after merge.

Merge Danger

Door: one-way

The module path changes, and the next release publishes to sarak.sh only.

Blast Radius: consumers

go install github.com/mikluko/flakybin and ghcr.io stop getting releases; 0fleet's OCIRepository moves to oci://sarak.sh/mikluko/charts/flakybin after 0.6.0 is out.

🤖 Generated with Claude Code

## Summary flakybin becomes the reference repository: changelog on fragments, Go tests and build in the nix sandbox, a nix flake, every job on the `nixos` runner. ```diff -Makefile, .ko.yaml # ko + helm by hand, to ghcr.io +flake.nix # package, image-amd64/arm64, checks.test (-race), checks.lint, devShell +VERSION # the flake's version; the release commit writes it +Taskfile.yaml, .golangci.yaml +CHANGELOG.md, .changelog/ # fragments; the release folds them +.forgejo/workflows/ + ci.yaml # PR, and called by release: nix flake check, nix build, helm lint; changelog validate on PR + release.yaml # dispatch: prepare -> ci -> publish -> tag +.github/workflows/mirror.yaml # GitHub mirrors sarak.sh go.mod: github.com/mikluko/flakybin -> sarak.sh/mikluko/flakybin ``` ```text release.yaml (workflow_dispatch, prerelease: bool) prepare final: release@v2 folds the fragments, VERSION=X, commit, push main prerelease: release@v2 prerelease -> X-pre.N, main untouched a dated entry no tag names (a failed run): neither, release that commit ci on that commit publish VERSION written and staged, nix build images, crane push, helm push tag POST /releases at that commit: the tag appears last ``` The tests run in the sandbox, which has a loopback of its own: the runner itself denies loopback to jobs, and `httptest.NewServer` in `crawl_test.go` and `log_test.go` needs it. ## Evidence - **Before:** no CI; `golangci-lint` 21 findings. **After:** `nix flake check` and `nix build` of the package and both images pass on the runner (this PR's CI); `helm lint --strict` ok. The release path runs first on the first dispatch after merge. ## Merge Danger **Door:** one-way The module path changes, and the next release publishes to sarak.sh only. **Blast Radius:** consumers `go install github.com/mikluko/flakybin` and `ghcr.io` stop getting releases; 0fleet's OCIRepository moves to `oci://sarak.sh/mikluko/charts/flakybin` after 0.6.0 is out. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Assisted-By: Claude <noreply@anthropic.com>
The tests and golangci-lint run as flake checks, inside the nix sandbox,
which gives them a loopback of their own on any runner.

Assisted-By: Claude <noreply@anthropic.com>
Assisted-By: Claude <noreply@anthropic.com>
Release from the changelog with Forgejo Actions
All checks were successful
CI / changelog (pull_request) Successful in 4s
CI / check (pull_request) Successful in 8s
1af73f9522
The flow is sniffarr's: fragments in .changelog/, Cut folds them into a
release pull request, merging it drafts, builds, pushes and publishes. Every
job runs on the nixos runner; the image, the chart and the source move from
ghcr.io and GitHub to sarak.sh, and GitHub becomes a mirror.

Assisted-By: Claude <noreply@anthropic.com>
Release by one dispatch, with pre-releases, from a VERSION file
All checks were successful
CI / changelog (pull_request) Successful in 3s
CI / check (pull_request) Successful in 8s
1a5cbdca53
The Release workflow folds the fragments, commits CHANGELOG.md and VERSION
to main, then checks, builds and pushes, and creates the release last, which
cuts the tag. With prerelease it cuts vX-pre.N from main untouched: VERSION
is overwritten and staged in the checkout, so the flake builds that version
without a commit. Cut and Build are gone.

The flake reads VERSION instead of --impure, so manifest-version runs again.

Assisted-By: Claude <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/flakybin!1
No description provided.