Build the image from a Nix flake in place of the Dockerfile #31

Merged
mikluko merged 5 commits from nix-image into main 2026-11-25 16:46:21 +00:00
Owner

Summary

 build.yaml / image
-  docker login
-  docker buildx build --platform linux/amd64,linux/arm64 --push   # on buildkitd
+  crane auth login
+  nix build --impure .#image-amd64 .#image-arm64                  # on the runners' nix-daemon
+  crane push  X.Y.Z-amd64, X.Y.Z-arm64
+  crane index append -t X.Y.Z

The image's entrypoint is the binary under /nix/store, so there is no /sniffarr and the chart drops command: [/sniffarr]. Images from the Dockerfile still work with that chart. skopeo was dropped because it refuses to run without a policy.json. vendorHash in flake.nix has to follow go.sum. The changelog's manifest-version is off: the flake reads the version from VERSION, which the changelog decides, rather than stating it.

Evidence

The image job's steps, run locally against crane registry serve:

  • index application/vnd.oci.image.index.v1+json, platforms linux/amd64, linux/arm64
  • entrypoint /nix/store/…-sniffarr-<version>/bin/sniffarr, user 65532:65532, OCI labels set
  • compressed layers, amd64: 20.2 MB for 0.45.0 from distroless, 19.9 MB from nix
  • helm lint --strict and helm template pass on every ci/*-values.yaml

Not yet run on Forgejo. The images have not been started in a container.

Merge Danger

Door: two-way

Restoring the Dockerfile and the old job brings back the previous build.

Blast Radius: image

A release whose image job fails leaves the draft and no tag.

🤖 Generated with Claude Code

## Summary ```diff build.yaml / image - docker login - docker buildx build --platform linux/amd64,linux/arm64 --push # on buildkitd + crane auth login + nix build --impure .#image-amd64 .#image-arm64 # on the runners' nix-daemon + crane push X.Y.Z-amd64, X.Y.Z-arm64 + crane index append -t X.Y.Z ``` The image's entrypoint is the binary under `/nix/store`, so there is no `/sniffarr` and the chart drops `command: [/sniffarr]`. Images from the Dockerfile still work with that chart. skopeo was dropped because it refuses to run without a `policy.json`. `vendorHash` in `flake.nix` has to follow `go.sum`. The changelog's `manifest-version` is off: the flake reads the version from `VERSION`, which the changelog decides, rather than stating it. ## Evidence The image job's steps, run locally against `crane registry serve`: - index `application/vnd.oci.image.index.v1+json`, platforms `linux/amd64`, `linux/arm64` - entrypoint `/nix/store/…-sniffarr-<version>/bin/sniffarr`, user `65532:65532`, OCI labels set - compressed layers, amd64: 20.2 MB for `0.45.0` from distroless, 19.9 MB from nix - `helm lint --strict` and `helm template` pass on every `ci/*-values.yaml` Not yet run on Forgejo. The images have not been started in a container. ## Merge Danger **Door:** two-way Restoring the Dockerfile and the old job brings back the previous build. **Blast Radius:** image A release whose image job fails leaves the draft and no tag. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The runners already reach the cluster's nix-daemon with flakes on, so the
job needs no installer and no buildkitd. Both platforms cross-compile on one
builder; crane pushes each under a -amd64/-arm64 tag and joins them in an
index. skopeo was dropped: it refuses to run without a policy.json, which the
runner image lacks.

Assisted-by: Claude Code (claude-opus-5-5)
Run the image entrypoint from the chart, not /sniffarr
All checks were successful
CI / changelog (pull_request) Successful in 4s
Build / packages (pull_request) Successful in 1m16s
CI / test (pull_request) Successful in 1m27s
Build / image (pull_request) Successful in 50s
Build / chart (pull_request) Successful in 5s
fc3cd2da52
Assisted-by: Claude Code (claude-opus-5-5)
mikluko force-pushed nix-image from fc3cd2da52
All checks were successful
CI / changelog (pull_request) Successful in 4s
Build / packages (pull_request) Successful in 1m16s
CI / test (pull_request) Successful in 1m27s
Build / image (pull_request) Successful in 50s
Build / chart (pull_request) Successful in 5s
to 72fbb5fc88
All checks were successful
CI / changelog (pull_request) Successful in 4s
Build / packages (pull_request) Successful in 2m8s
CI / test (pull_request) Successful in 2m21s
Build / image (pull_request) Successful in 36s
Build / chart (pull_request) Successful in 5s
2026-11-25 16:21:18 +00:00
Compare
mikluko force-pushed nix-image from 72fbb5fc88
All checks were successful
CI / changelog (pull_request) Successful in 4s
Build / packages (pull_request) Successful in 2m8s
CI / test (pull_request) Successful in 2m21s
Build / image (pull_request) Successful in 36s
Build / chart (pull_request) Successful in 5s
to 938c4fc715
Some checks failed
CI / changelog (pull_request) Successful in 6s
Build / packages (pull_request) Has been cancelled
Build / image (pull_request) Has been cancelled
Build / chart (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
2026-11-25 16:24:29 +00:00
Compare
mikluko force-pushed nix-image from 938c4fc715
Some checks failed
CI / changelog (pull_request) Successful in 6s
Build / packages (pull_request) Has been cancelled
Build / image (pull_request) Has been cancelled
Build / chart (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
to 4e057334f7
Some checks failed
CI / changelog (pull_request) Successful in 6s
Build / packages (pull_request) Has been cancelled
Build / image (pull_request) Has been cancelled
Build / chart (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
2026-11-25 16:26:30 +00:00
Compare
mikluko force-pushed nix-image from 4e057334f7
Some checks failed
CI / changelog (pull_request) Successful in 6s
Build / packages (pull_request) Has been cancelled
Build / image (pull_request) Has been cancelled
Build / chart (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
to d1cc80ea18
All checks were successful
CI / changelog (pull_request) Successful in 4s
Build / packages (pull_request) Successful in 1m50s
CI / test (pull_request) Successful in 2m13s
Build / image (pull_request) Successful in 1m3s
Build / chart (pull_request) Successful in 6s
2026-11-25 16:28:12 +00:00
Compare
mikluko force-pushed nix-image from d1cc80ea18
All checks were successful
CI / changelog (pull_request) Successful in 4s
Build / packages (pull_request) Successful in 1m50s
CI / test (pull_request) Successful in 2m13s
Build / image (pull_request) Successful in 1m3s
Build / chart (pull_request) Successful in 6s
to c1e169a9c3
All checks were successful
CI / changelog (pull_request) Successful in 6s
Build / packages (pull_request) Successful in 2m26s
CI / test (pull_request) Successful in 3m6s
Build / image (pull_request) Successful in 53s
Build / chart (pull_request) Successful in 8s
2026-11-25 16:32:37 +00:00
Compare
mikluko deleted branch nix-image 2026-11-25 16:46:22 +00:00
Sign in to join this conversation.
No description provided.