Skip to content

Automate source tracking, cache publication and channel refs - #14

Merged
DjDeveloperr merged 11 commits into
mainfrom
feat/update-automation-20261023
Oct 23, 2026
Merged

DjDeveloperr merged 11 commits into
mainfrom
feat/update-automation-20261023

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Automates NixOS updates from source branch to installed Macs. Overview, threat model and key procedures: aurora-distributions docs/updates.md (aurora-silicon/aurora-distributions#5); runbook: docs/updates.md here.

The cache key leaves the build jobs. checks.yml signed its export with NIX_CACHE_SIGNING_KEY on every push or manual run from any branch. Builds now export an unsigned cache (NARs checked with --no-trust) and attest the artifact. publish-cache.yml collects without secrets, sends only the narinfo files to a testing-signing job (scripts/sign-cache-metadata.py, OpenSSL; its tests pin Nix's fingerprint format to a signature the production key made, and it verifies all 976 live narinfo signatures), then has Nix verify every signature and NAR before releasing with an attestation.

The empty attempt-1 artifact: run 39747554132's first kernel attempt failed on a codeload 429 inside fetchurl and, with if: always(), uploaded a 136-byte nix-kernel-closure beside the real 1.2 GB one. Builds now prefetch pinned archives into the store (verified source cache, then codeload with Retry-After backoff), failed attempts upload as failed-nix-<pkg>-attempt-N, and the collector takes the newest artifact per name and skips one without a build record.

No run lists: publish-cache.yml finds the newest cache release and the eligible builds itself and requests main builds for outputs that have none.

Channels: Git refs channel-testing (moved by deploy-cache.yml after HTTP verification of every NAR, attestation check and a pin-history check) and channel-stable (moved by promote.yml after a stable-promotion reviewer, soak time and a signed-coverage check of every hardware output). images.yml takes channel: pinned (default, today's exact-commit input), testing or stable.

Source tracking: as in the other repos; writes sha256 and the SRI nix_hash, kernel/provenance.json, locks/aura.Cargo.lock (a changed git dependency needs a person) and the kernel/Mesa version on version changes.

Flagged: installed NixOS never refreshes Stage 2 (aura and DTBs) on rebuild (nixosModules.installed); not changed here, listed as a decision.

Tests

  • Unit tests (Python 3.12 and 3.14), actionlint.
  • deploy-cache.yml 39892235562: verified every entry and NAR of cache-testing-20261023.1 over HTTP and the pin history.
  • publish-cache.yml 39892314696 against cache-testing-20261022.2: found the two outputs missing from that base (aura, uboot) and 41 candidate runs without a run list, authenticated both artifacts, signed only their narinfo files with a throwaway key, and Nix verified every NAR and every OpenSSL-made signature.
  • New build path end to end: checks.yml 39893842307 on this branch prefetched the pinned sources, built aura, exported an unsigned cache and attested the artifact; publish-cache.yml 39894002637 then took aura from that run (attestation verified, NARs checked with --no-trust) and uboot from main run 39879556200, signed the narinfo files with a throwaway key and had Nix verify them.
  • PR CI: every hardware output (kernel and Mesa included) built with the new prefetch step.

updatelib.py and trackerlib.py are shared verbatim with alarm-aurora and
fedora-aurora: downloads with Retry-After-aware backoff and checksum
fall-through, Nix SRI hashes, a Git tree proof that an archive is exactly
its commit, version comparison, a kernel/Mesa GPU UAPI comparison,
channel state on a `channels` branch, and the source-tracking PR and
merge logic.
track-sources.yml checks aurora-silicon/aura main, aurora-silicon/linux
integration/aurora and aurora-silicon/mesa aurora-wip every 30 minutes
once TRACK_SOURCES is true. A read-only job downloads each new archive,
proves it against the commit's Git tree and writes the pin: commit, URL,
archive root, SHA-256 and the same hash in SRI form for fetchurl. It also
updates kernel/provenance.json, takes locks/aura.Cargo.lock from the
archive (a changed git dependency needs a person for outputHashes) and,
on a version change, the kernel or Mesa version in overlay.nix or
mesa.nix. A second job commits the patch to auto/track-sources, opens or
refreshes one PR and dispatches checks.yml for the changed outputs.

With AUTO_MERGE_SOURCES true the PR is merged when every run on its head
passed and tracking.json's policy allows it. Pins in another repository
than the tracked one are reported, not changed. Every pinned archive,
bindgen's included, is kept in a `source-cache` release.
checks.yml signed its export with the cache key on every push or manual
run, from any branch. Builds now export an unsigned cache, check every
NAR against its metadata and attest the artifact; the publisher signs
after authenticating it.

Run 39747554132's first kernel attempt failed on a codeload 429 inside
fetchurl and, because the upload ran on always(), left a 136-byte
nix-kernel-closure beside the real 1.2 GB one from the re-run. Builds now
place pinned archives in the store first, from the verified source cache
or with Retry-After-aware retries; failed attempts upload under
failed-nix-<package>-attempt-N; and the collector takes the newest
artifact of each name, skips one without a build record and verifies the
attestation of every build whose workflow records one.
…data

publish-cache.yml finds the newest cache release and the eligible native
builds itself, and when an output has no current build it requests a
main build of exactly that output. Collection runs without secrets; the
signing job in the testing-signing environment receives only the narinfo
files, whose signature covers path, NAR hash, size and references, and
signs them with OpenSSL. The release job then has Nix verify every
signature and NAR before anything is published, and attests every asset.
A dry run does all of it with a throwaway key.

sign-cache-metadata.py's tests pin Nix's fingerprint format to a
signature the production key made.
A NixOS channel is a Git ref: channel-testing moves when a cache release
is deployed, channel-stable when promote.yml promotes a commit testing
served, after a stable-promotion reviewer approves, the soak time has
passed and every hardware output of that commit is signed in the live
cache. Deployment also verifies the release's attestation and refuses a
source pin that would move backwards. channels.json on the `channels`
branch records the live cache and both commits.

images.yml takes what /etc/nixos/flake.nix follows: pinned (the default,
today's exact-commit input), testing or stable. Image builds attest the
filesystem archive; payload-after-images.yml can publish a payload after
each image build (AUTO_PAYLOADS).
docs/updates.md is the NixOS runbook; the README describes the unsigned build exports and run-list-free publication.
A called workflow cannot exceed the permissions of its calling job; the optional image dispatch after a testing deploy needs actions: write.
A compiler error while laying out the GPU UAPI records now becomes a reported conflict with its message, instead of failing the whole plan.
Recent kernel UAPI headers include linux/bits.h, which the runner's
system headers lack; the kernel's own copy is used only where the system
has none, and a header that does not compile is now reported instead of
silently comparing nothing.

The workflow token cannot open pull requests while the repository keeps
"Allow GitHub Actions to create and approve pull requests" off. With
TRACKER_APP_CLIENT_ID set, the tracker uses a GitHub App token whose key
lives in the source-tracking environment; App merges also start the
normal push builds.
Point the payload callers at aurora-distributions 2225014, whose
build-payload.yml assembles without credentials, signs the catalog in a
small job that runs in this repository's catalog-signing environment,
and attests every payload asset. The calling jobs grant the id-token and
attestations permissions that needs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant