clan: the target prefetches tarball-pinned flake inputs too — nixpkgs' 196 MiB source stops pushing from the operator (GOTCHAS #342) #1862

Merged
ben merged 2 commits from session/gateway-pulls-own-software into main 2026-09-25 03:32:49 +00:00
Owner

This is part 1 of Ben's ruling to make the gateway pull its own software.

Measured live on WKT-DEMO fire 4 (drive 20260925T023906Z, #1855). During enroll-copy, bens-mac-04 pushed at ~386 kB/s for ~20 min. The box was receiving /nix/store/lr5ld8f0…-source, the 196 MiB nixpkgs tree.

Checked against cache.nixos.org, both closures lack the same small share:

Closure Total Missing from cache.nixos.org
Enrolled system 2104 MiB 338 MiB
Files deploy system 3109 MiB 338 MiB

That nixpkgs source is 196 MiB of the missing 338 MiB.

Cause. #1803's prefetchInputsOnTarget read only type: github lock nodes. clan-core pins nixpkgs as a releases.nixos.org tarball, so the prefetch skipped it.

Fix. prefetchRefsFromLock also renders each tarball input as url?narHash=<sri>, beside the github revs. A hand prefetch of that ref realised the identical /nix/store/lr5ld8f0…-source. A tarball with no narHash, or a git source, is still left to the copy.

Tests. Three new tests failed before the fix and pass after it. The internal/clan suite, go vet and golangci-lint are clean. GOTCHAS #342 and a STATUS entry are included.

Part 2 follows. The rented gateway will build its own system, so the operator machine neither downloads the whole closure nor pushes the ~140 MiB it compiles.

Refs #1855

🤖 Generated with Claude Code

https://claude.ai/code/session_013h5C35beyRQMAA1QjxZGk7

This is part 1 of Ben's ruling to make the gateway pull its own software. **Measured live on WKT-DEMO fire 4** (drive `20260925T023906Z`, #1855). During `enroll-copy`, bens-mac-04 pushed at ~386 kB/s for ~20 min. The box was receiving `/nix/store/lr5ld8f0…-source`, the 196 MiB nixpkgs tree. Checked against cache.nixos.org, both closures lack the same small share: | Closure | Total | Missing from cache.nixos.org | |---|---|---| | Enrolled system | 2104 MiB | 338 MiB | | Files deploy system | 3109 MiB | 338 MiB | That nixpkgs `source` is 196 MiB of the missing 338 MiB. **Cause.** #1803's `prefetchInputsOnTarget` read only `type: github` lock nodes. clan-core pins nixpkgs as a releases.nixos.org tarball, so the prefetch skipped it. **Fix.** `prefetchRefsFromLock` also renders each tarball input as `url?narHash=<sri>`, beside the github revs. A hand prefetch of that ref realised the identical `/nix/store/lr5ld8f0…-source`. A tarball with no narHash, or a git source, is still left to the copy. **Tests.** Three new tests failed before the fix and pass after it. The `internal/clan` suite, `go vet` and golangci-lint are clean. GOTCHAS #342 and a STATUS entry are included. **Part 2 follows.** The rented gateway will build its own system, so the operator machine neither downloads the whole closure nor pushes the ~140 MiB it compiles. Refs #1855 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013h5C35beyRQMAA1QjxZGk7
clan: the target prefetches tarball-pinned flake inputs too — nixpkgs' 196 MiB source stops pushing from the operator (GOTCHAS #342)
Some checks failed
ci / publish (pull_request) Has been cancelled
ci / publish-broker (pull_request) Has been cancelled
ci / deploy-broker (pull_request) Has been cancelled
ci / seam (pull_request) Has been cancelled
3a5d66348e
clan-core pins nixpkgs as a releases.nixos.org tarball, so #1803's
github-only prefetch skipped it and every rented enroll-copy pushed the
196 MiB nixpkgs `source` over the operator's uplink (WKT-DEMO fire 4, live:
~386 kB/s for ~20 min). prefetchRefsFromLock renders tarball inputs as
`url?narHash=<sri>` beside the github revs; a hand prefetch realised the
identical /nix/store/lr5ld8f0…-source.

Part 1 of Ben's ruling "make the gateway pull its own software".

Refs #1855

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013h5C35beyRQMAA1QjxZGk7
clan: mark the flake.lock decode wireconvention:external — narHash is nix's field name, not our wire
All checks were successful
ci / seam (pull_request) Successful in 20m30s
ci / publish-broker (pull_request) Has been skipped
ci / publish (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
e03e94f758
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013h5C35beyRQMAA1QjxZGk7
ben merged commit 5066869547 into main 2026-09-25 03:32:49 +00:00
Sign in to join this conversation.
No reviewers
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
Matou/idss!1862
No description provided.