Expand description
Producer for releases/fleet.resolved.json and signed sidecars. Pipeline:
enumerate hosts -> build -> push -> eval -> inject closureHashes -> stamp meta
-> canonicalize -> sign -> smoke-verify -> atomic write -> optional git
commit/push. Hook contract lives at the binary surface.
Modulesยง
- git ๐
- Git plumbing - shells out to
git, never embeds a library. - sign ๐
- Sign-hook + smoke-verify + atomic release-dir write.
Structsยง
- GitPush
Target - Release
Config - CLI-assembled config consumed by
run.
Enumsยง
- Host
Kind - Which
*Configurationsattrset a host lives in. - Hosts
Spec - Hosts to release. Resolved against the consumerโs flake at runtime.
- RunOutcome
Functionsยง
- build_
hosts ๐ - Sequential build. No pin or pin.commit == current_commit -> local build
path; non-current commit -> flake-ref build via
<pin_source_url>?rev=<commit>. Cross-platform builds rely on the operatorโsnix.buildMachines. Failures abort before any push. - build_
local ๐ - build_
pinned ๐ - Build via flake-ref at a different commit. The
url?rev=<commit>form lets Nix handle checkout + caching; we donโt manage a worktree ourselves. - canonicalize_
resolved - closure_
hash ๐ - enumerate_
hosts ๐ (host, kind)pairs. NixOS sorted, then Darwin sorted;Explicitpreserves caller order. Missing attrsets are empty, not errors.- eval_
bootstrap_ ๐nonces - eval_
fleet_ ๐resolved - eval_
revocations ๐ - filter_
expired_ pins - Drop expired pins (past
expires_at); affected hosts fall back to the current-commit build path. Pins with noexpires_atalways remain. - inject_
closure_ hashes - Sets
hosts[h].closureHash. Unknown hosts inhashesare silently skipped. - interpret_
build_ ๐output - list_
attr_ ๐optional - Enumerate attribute names; missing attrset -> empty. โMissing attributeโ matches a small set of stable nix-eval phrasings.
- load_
existing_ ๐signed_ at_ if_ unchanged - Returns existing
meta.signedAtwhen on-disk closure hashes match. - pin_
target_ ๐commit Some(commit)iff the host has a pin ANDpin.commit โ current_commit. Same-commit pins returnNoneso the local build path handles them.- prune_
expired_ ๐bootstrap_ nonces - Strip entries with
expires_at < signed_at. Run at sign time so the signed artifact only contains the operational set; fleet.nix can keep historical entries as an audit log. - push_
one ๐ - render_
commit_ message - run
- sha256_
hex ๐ - stamp_
meta - validate_
config ๐ - validate_
pin_ ๐source_ url - Errors when any host has a non-current-commit pin but
--pin-source-urlis unset. Run AFTERfilter_expired_pinsso expired pins arenโt counted.