feat(nix): package gitea-axi as a flake with a PATH-suffixing wrapper (task 0037) #46
Reference in New Issue
Block a user
Delete Branch "task-0037-flake-package-and-wrapper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements
.claude/tasks/0037-flake-package-and-wrapper.md.What was built
A flake at the repository root exposing gitea-axi as a package, with the derivation in its own callable expression (
package.nix) that the flake consumes — so it evaluates outside a flake context and is usable in an overlay unchanged. Verified: plaincallPackageproduces the identicaldrvPathas the flake build.importNpmLock, so no fixed-output hash to maintain and a dependency bump edits no Nix expression.licenseis looked up by SPDX id from the same manifest for the same reason.bench/file,PUBLISHING.md, orvitest.e2e.config.tsleaves the output path untouched, while touchingsrc/cli.tschanges it.--suffix PATHper ADR 0018. With no ambientPATHat all the closure'steais found (AUTH_REQUIRED, notTEA_NOT_INSTALLED); with an operatorteaearlier onPATH, that one is invoked.Deviations
Three systems, not four. nixpkgs 26.11 dropped
x86_64-darwin, andlegacyPackages.x86_64-darwinnow throws rather than merely failing to build — listing it would breaknix flake showandnix flake checkfor every system at once. Coverage isx86_64-linux,aarch64-linux,aarch64-darwin. This is the one criterion marked[-]. The spec still reads "four common Linux and Darwin targets"; it was left as the historical design record rather than amended.doCheck = truewas silently inert.buildNpmPackagesupplies no check hook, so the first green build loggedno Makefile or custom checkPhase, doing nothingand shipped a package whose tests had never run. Fixed with an explicitcheckPhaseplusgit/whichinnativeCheckInputsand a writableHOME. Recorded as a Gotcha, since the failure mode is a green build.postUnpackrenames the build tree, which the task did not ask for.test/setup.test.tspasses only when the checkout path contains the substringgitea-axi, so the builder's genericsourcedirectory fails it. Verified outside Nix by copying the repo to a clean path. The rename makes the build environment representative of a real install; it is commented as a workaround and is scheduled for deletion in task 0042.ADR 0018 landed earlier in
0cbfe43during the planning pass, so that criterion is satisfied by an earlier commit rather than this one.Follow-up: the spec's open verification item is answered, unfavourably
Evidence recorded in
0042. The SDK does not prefer the bare binary name — it records the absolute entrypoint path unlessPATHresolution matches. Under Nix that is the content-addressed store path, so theSessionStarthook silently stops running after a rebuild or GC. A second defect from the same line makessetup hooksappend duplicates instead of updating in place. Both were deliberately left to 0042 rather than pre-empting its design work here.Review
Risk
Overall: Medium
src/ortest/touched, purely additive install channel.nix build.postInstallwraps the credential-resolution path;--suffixcorrectly keeps the operator'steaand its in-place OAuth refresh authoritative.Unaddressed findings
Spec — the spec text still says "four common Linux and Darwin targets". Left divergent deliberately: the spec is a design record, and the reason for three is captured in the task's Implementation Notes, an inline comment at the
systemslist, and a CLAUDE.md Gotcha.Standards — the
x86_64-darwinand inert-doCheckrationales each appear in three places (inline comment, CLAUDE.md Gotcha, task notes). Two copies are required by repo convention; the third sits where a future editor would re-add the system. Noted only so drift is noticed.Findings addressed in the diff: hardcoded
licensenow derived from the manifest by SPDX id, andtest/e2eexcluded from the source allowlist so end-to-end churn no longer invalidates the derivation.