From bb57faf61eef25aed7504d4d2e96cdd9f607f3bf Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 15 Oct 2026 22:58:48 -0700 Subject: [PATCH 1/4] quest: claim m0/ci/nix-cache Co-Authored-By: Claude Opus 5.5 From 411f5a89e5b18fa1db0250f23bd50d9273cab1f5 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 15 Oct 2026 23:11:36 -0700 Subject: [PATCH 2/4] ci: serve the Nix cache from nix.moq.dev instead of Cachix R2 behind a Worker replaces kixelated.cachix.org: a release bucket that never expires and a CI bucket that a lifecycle rule expires after 30 days. cache.yml pushes the dev shell from main and release-nix.yml (formerly cachix.yml) pushes tagged packages, each through a GitHub Environment that holds the signing key. Workflows install Nix through one local action that accepts the flake's nixConfig, so flake.nix is the only place naming the cache. The public key is a placeholder until the maintainer generates it. Co-Authored-By: Claude Opus 5.5 --- .github/actions/nix/action.yml | 16 ++ .github/actions/setup-packaging/action.yml | 4 +- .github/workflows/alert.yml | 2 +- .github/workflows/audio-quality.yml | 8 +- .github/workflows/cache.yml | 43 ++-- .github/workflows/check.yml | 33 +-- .github/workflows/interop.yml | 13 +- .github/workflows/moq-c.yml | 9 +- .github/workflows/moq-gst.yml | 9 +- .github/workflows/moq-sh.yml | 9 +- .github/workflows/nightly.yml | 41 +-- .github/workflows/obs.yml | 9 +- .github/workflows/quest.yml | 9 +- .github/workflows/release-binary.yml | 9 +- .github/workflows/release-js.yml | 9 +- .../workflows/{cachix.yml => release-nix.yml} | 51 ++-- .github/workflows/release-py.yml | 9 +- .github/workflows/release-rs.yml | 12 +- .github/workflows/ts.yml | 7 +- .github/workflows/uring.yml | 7 +- .github/workflows/video.yml | 9 +- .github/workflows/wasm.yml | 9 +- .github/workflows/x11.yml | 7 +- doc/setup/install.md | 5 +- flake.nix | 20 +- infra/README.md | 108 +++++++- infra/justfile | 2 + infra/nix/bun.lock | 241 ++++++++++++++++++ infra/nix/justfile | 44 ++++ infra/nix/lifecycle.json | 10 + infra/nix/package.json | 12 + infra/nix/src/worker.ts | 73 ++++++ infra/nix/wrangler.jsonc | 34 +++ nix/overlay.nix | 4 +- quest/m0/ci/README.md | 2 +- quest/m0/ci/nix-cache-verify.md | 27 ++ quest/m0/ci/nix-cache.md | 37 --- rs/moq-gst/scrub.sh | 2 +- 38 files changed, 652 insertions(+), 303 deletions(-) create mode 100644 .github/actions/nix/action.yml rename .github/workflows/{cachix.yml => release-nix.yml} (51%) create mode 100644 infra/nix/bun.lock create mode 100644 infra/nix/justfile create mode 100644 infra/nix/lifecycle.json create mode 100644 infra/nix/package.json create mode 100644 infra/nix/src/worker.ts create mode 100644 infra/nix/wrangler.jsonc create mode 100644 quest/m0/ci/nix-cache-verify.md delete mode 100644 quest/m0/ci/nix-cache.md diff --git a/.github/actions/nix/action.yml b/.github/actions/nix/action.yml new file mode 100644 index 00000000000..3c920094001 --- /dev/null +++ b/.github/actions/nix/action.yml @@ -0,0 +1,16 @@ +name: Install Nix +description: Install Nix and trust the flake's own nixConfig, which names the nix.moq.dev cache. + +runs: + using: composite + steps: + # Nix ignores a flake's `nixConfig` unless told to accept it, and would then + # rebuild from source everything nixpkgs doesn't serve: ~12 minutes of + # uniffi-bindgen-go alone in every job that enters the dev shell. Accepting + # it keeps flake.nix the only place that names the cache and its key. The + # flake is this checkout, which these jobs already run as code. + - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main + with: + determinate: false + extra-conf: | + accept-flake-config = true diff --git a/.github/actions/setup-packaging/action.yml b/.github/actions/setup-packaging/action.yml index 933dd58e870..16c7f13fd4d 100644 --- a/.github/actions/setup-packaging/action.yml +++ b/.github/actions/setup-packaging/action.yml @@ -4,9 +4,7 @@ description: Install Nix and prepend the .#packaging output bin/ to $PATH. runs: using: composite steps: - - uses: DeterminateSystems/nix-installer-action@00199f951aeb9404028a6e4b95ad42546f73296a # main - with: - determinate: false + - uses: ./.github/actions/nix - name: Build packaging tools from flake shell: bash diff --git a/.github/workflows/alert.yml b/.github/workflows/alert.yml index d0cdc38dec0..50f0181740d 100644 --- a/.github/workflows/alert.yml +++ b/.github/workflows/alert.yml @@ -26,7 +26,6 @@ on: workflows: - apt-repo - Cache - - Cachix - Check - Docker - Interop @@ -49,6 +48,7 @@ on: - Release JS - Release Kotlin FFI - Release Kotlin lib + - Release Nix - Release Py - Release Py FFI - Release RS diff --git a/.github/workflows/audio-quality.yml b/.github/workflows/audio-quality.yml index 1ad4af43cc9..c50dde94482 100644 --- a/.github/workflows/audio-quality.yml +++ b/.github/workflows/audio-quality.yml @@ -37,13 +37,7 @@ jobs: with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter; see check.yml. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Replay run: nix develop --command just test audio-quality --replays --enforce diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 9214eb91f41..f21761981d9 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -1,7 +1,10 @@ name: Cache # Populates the Rust build cache that pull request jobs restore, and the dev -# shell closure that every nix job substitutes. +# shell closure that every nix job substitutes from nix.moq.dev. +# +# The Nix signing key and the CI bucket's write key live in the `cache-write` +# Environment, which only `main` can deploy to. # # Actions scopes cache reads to the current branch plus the default branch, so # only caches written here on `main` are reachable from a pull request. This @@ -32,6 +35,8 @@ on: - "rust-toolchain.toml" - "flake.nix" - "flake.lock" + # Patches and lockfiles the dev shell builds from. + - "nix/**" - ".github/workflows/cache.yml" # The action pin and the cache key both live here, and either can roll # the store. Without this the sole writer would not re-run after such a @@ -61,6 +66,7 @@ jobs: rust: false runs-on: ${{ matrix.runner }} timeout-minutes: 60 + environment: cache-write steps: - name: Free disk space @@ -73,37 +79,24 @@ jobs: with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter. `nixConfig` in flake.nix is - # untrusted by default, so nix logs "ignoring untrusted flake - # configuration setting 'extra-substituters'" and rebuilds from - # source anything missing from the public nixpkgs cache. That was - # costing 678s per job for uniffi-bindgen-go alone, in every job that - # enters the dev shell. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - - # cachix.yml only fires on release tags and only pushes the tagged - # package, so the dev shell itself was never cached. Anything in it that - # nixpkgs doesn't serve prebuilt (uniffi-bindgen-go, a - # buildRustPackage from a git tag) was therefore compiled from source by - # every job that entered the shell. Push it once here so pull requests - # substitute it instead. - - uses: cachix/cachix-action@38b082610b782e7e93e209c35fd730d399dee866 # v17 - with: - name: kixelated - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + - uses: ./.github/actions/nix + # Anything in the dev shell that nixpkgs doesn't serve prebuilt + # (uniffi-bindgen-go, a buildRustPackage from a git tag) would otherwise + # compile from source in every job that enters it. Only paths missing + # from the bucket upload, so this also restores whatever its lifecycle + # rule expired. - name: Cache the dev shell + env: + NIX_SIGNING_KEY: ${{ secrets.NIX_SIGNING_KEY }} + AWS_ACCESS_KEY_ID: ${{ secrets.NIX_R2_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.NIX_R2_SECRET_ACCESS_KEY }} run: | # `--profile` realises the shell's full build closure, which is what # the runners actually need; `nix build .#devShells...` alone leaves # out the build-time inputs. nix develop --profile /tmp/devshell --command true - cachix push kixelated /tmp/devshell + nix develop --command just infra nix push nix-ci-moq-dev /tmp/devshell # The single writer. `save-on-dispatch` is what lets the # `workflow_dispatch` above prime a cold store; the action otherwise saves diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b81f255a8c5..b3a1d04e4db 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -55,19 +55,8 @@ jobs: with: tool-cache: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main + - uses: ./.github/actions/nix if: steps.scope.outputs.needed == 'true' - with: - determinate: false - # Trust the flake's cachix substituter. `nixConfig` in flake.nix is - # untrusted by default, so nix logs "ignoring untrusted flake - # configuration setting 'extra-substituters'" and rebuilds from - # source anything missing from the public nixpkgs cache. That was - # costing 678s per job for uniffi-bindgen-go alone, in every job that - # enters the dev shell. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - uses: DeterminateSystems/flake-checker-action@786422608c7bded2bbc9741ad9f91356842bf520 # main if: steps.scope.outputs.needed == 'true' @@ -127,19 +116,8 @@ jobs: with: tool-cache: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main + - uses: ./.github/actions/nix if: steps.scope.outputs.needed == 'true' - with: - determinate: false - # Trust the flake's cachix substituter. `nixConfig` in flake.nix is - # untrusted by default, so nix logs "ignoring untrusted flake - # configuration setting 'extra-substituters'" and rebuilds from - # source anything missing from the public nixpkgs cache. That was - # costing 678s per job for uniffi-bindgen-go alone, in every job that - # enters the dev shell. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= # Restore only, same as the `check` job above. - name: Rust cache @@ -185,13 +163,8 @@ jobs: with: tool-cache: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main + - uses: ./.github/actions/nix if: steps.scope.outputs.needed == 'true' - with: - determinate: false - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= - name: Rust cache if: steps.scope.outputs.needed == 'true' diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index 676469e81a6..c8a57fab563 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -57,18 +57,7 @@ jobs: with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter. `nixConfig` in flake.nix is - # untrusted by default, so nix logs "ignoring untrusted flake - # configuration setting 'extra-substituters'" and rebuilds from - # source anything missing from the public nixpkgs cache. That was - # costing 678s per job for uniffi-bindgen-go alone, in every job that - # enters the dev shell. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix # Reuse ~/.cargo + ./target across nightly runs so only changed crates # recompile (the relay, cli, moq-ffi, and moq-c all build from source). diff --git a/.github/workflows/moq-c.yml b/.github/workflows/moq-c.yml index e95b9de48d5..bb8c11d6c8f 100644 --- a/.github/workflows/moq-c.yml +++ b/.github/workflows/moq-c.yml @@ -44,14 +44,7 @@ jobs: - name: Install Nix if: matrix.use_nix - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, as check.yml does, so the dev - # shell is substituted rather than built from source. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + uses: ./.github/actions/nix - name: Install Rust (Windows) if: '!matrix.use_nix' diff --git a/.github/workflows/moq-gst.yml b/.github/workflows/moq-gst.yml index 09d8b173d80..c350a1105d6 100644 --- a/.github/workflows/moq-gst.yml +++ b/.github/workflows/moq-gst.yml @@ -36,14 +36,7 @@ jobs: - uses: ./.github/actions/just - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, as check.yml does, so the dev - # shell is substituted rather than built from source. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Parse version id: parse diff --git a/.github/workflows/moq-sh.yml b/.github/workflows/moq-sh.yml index fcf31e294bc..caf48d97863 100644 --- a/.github/workflows/moq-sh.yml +++ b/.github/workflows/moq-sh.yml @@ -63,14 +63,7 @@ jobs: with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, as check.yml does, so the dev - # shell is substituted rather than built from source. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Deploy env: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3b6b5606dcd..4b0c5269e3b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -104,14 +104,7 @@ jobs: with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, as check.yml does, so the dev - # shell is substituted rather than built from source. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix # Restore only, like `tests` below. Saving its own store cost 3.6 GB of the # repository's 10 GB budget and evicted the one every pull request restores. @@ -161,14 +154,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, as check.yml does, so the dev - # shell is substituted rather than built from source. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Rust cache uses: ./.github/actions/rust-cache - name: Test @@ -198,12 +184,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Rust cache uses: ./.github/actions/rust-cache # Playwright's Chromium isn't in the nix devShell; `--with-deps` installs @@ -334,12 +315,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - uses: ./.github/actions/rust-cache - name: Collect and compare sizes run: nix develop --command just gh size-nightly size-report "$GITHUB_RUN_ID" @@ -377,14 +353,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, as check.yml does, so the dev - # shell is substituted rather than built from source. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Install nightly Rust uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable with: diff --git a/.github/workflows/obs.yml b/.github/workflows/obs.yml index 3d5c965894a..7161965b22b 100644 --- a/.github/workflows/obs.yml +++ b/.github/workflows/obs.yml @@ -107,14 +107,7 @@ jobs: with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, so the dev shell substitutes - # instead of building from source. See check.yml for the full story. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix # cache.yml warms the default-branch store on `main`. Pull requests restore # it; the action refuses to publish from a pull request. It holds diff --git a/.github/workflows/quest.yml b/.github/workflows/quest.yml index 6243925a6c1..db81b3347c6 100644 --- a/.github/workflows/quest.yml +++ b/.github/workflows/quest.yml @@ -44,14 +44,7 @@ jobs: with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, which holds the quest build - # as part of the dev shell closure; see check.yml. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix # The whole tree, unscoped: a push has no base to diff against. # diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index 88350386f05..e87e1c1441e 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -132,14 +132,7 @@ jobs: - uses: ./.github/actions/just - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, as check.yml does, so the dev - # shell is substituted rather than built from source. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Parse version id: parse diff --git a/.github/workflows/release-js.yml b/.github/workflows/release-js.yml index 81b8f36f729..cd380cbfb52 100644 --- a/.github/workflows/release-js.yml +++ b/.github/workflows/release-js.yml @@ -35,14 +35,7 @@ jobs: with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, as check.yml does. Without it - # `nix develop` built the dev shell from source, about 13 minutes. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Setup npm registry uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6 diff --git a/.github/workflows/cachix.yml b/.github/workflows/release-nix.yml similarity index 51% rename from .github/workflows/cachix.yml rename to .github/workflows/release-nix.yml index 0e029232464..f76c4b993d4 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/release-nix.yml @@ -1,4 +1,11 @@ -name: Cachix +name: Release Nix + +# Pushes each released package to nix.moq.dev, so `nix run` on a release tag +# substitutes it instead of building from source. +# +# The signing key and the release bucket's write key live in the +# `nix-release` Environment, which only these tag patterns can deploy from. A +# tag ruleset limits who can create them; see infra/README.md. on: push: @@ -13,22 +20,18 @@ jobs: # Build and push only the package the tag names. The tag prefix # (e.g. moq-relay) is the flake attribute, except moq-cli ships as moq. release: - name: Release (${{ matrix.os }}) + name: Release (${{ matrix.runs-on }}) runs-on: ${{ matrix.runs-on }} + environment: nix-release permissions: contents: read strategy: fail-fast: false matrix: - include: - # `os` is just the cache pin label; keep the existing values stable so - # old pins aren't orphaned. - - os: ubuntu-latest # x86_64-linux - runs-on: ubuntu-latest - - os: macos-latest # aarch64-darwin - runs-on: macos-latest - - os: aarch64-linux - runs-on: ubuntu-24.04-arm + runs-on: + - ubuntu-latest # x86_64-linux + - ubuntu-24.04-arm # aarch64-linux + - macos-latest # aarch64-darwin steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -52,25 +55,17 @@ jobs: [[ "$name" == moq-cli ]] && name=moq echo "name=${name}" >> "$GITHUB_OUTPUT" - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - - - uses: cachix/cachix-action@38b082610b782e7e93e209c35fd730d399dee866 # v17 - with: - name: kixelated - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + - uses: ./.github/actions/nix + - uses: ./.github/actions/just - - name: Build and cache + # The release bucket has no lifecycle rule, unlike the CI one, so a flake + # pinned to an old tag still substitutes. + - name: Build and push env: PACKAGE: ${{ steps.pkg.outputs.name }} - OS: ${{ matrix.os }} + NIX_SIGNING_KEY: ${{ secrets.NIX_SIGNING_KEY }} + AWS_ACCESS_KEY_ID: ${{ secrets.NIX_R2_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.NIX_R2_SECRET_ACCESS_KEY }} run: | nix build ".#$PACKAGE" --print-build-logs - cachix push kixelated ./result - # Pin so released paths are exempt from GC, otherwise a consumer - # pinning a few-weeks-old tag silently falls back to building once - # the cache GCs the path. keep-revisions bounds storage for the - # free plan; the pin name is per package+OS so each platform keeps - # its own last-N releases instead of clobbering the other's. - cachix pin kixelated "$PACKAGE-$OS" ./result --keep-revisions 10 + just infra nix push nix-moq-dev ./result diff --git a/.github/workflows/release-py.yml b/.github/workflows/release-py.yml index 51fb6f5bd52..24e901b7ab8 100644 --- a/.github/workflows/release-py.yml +++ b/.github/workflows/release-py.yml @@ -104,14 +104,7 @@ jobs: VERSION: ${{ steps.version.outputs.version }} run: just gh release pypi-exists moq-rs "$VERSION" - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, as check.yml does, so the dev - # shell is substituted rather than built from source. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Build run: nix develop --command just py package diff --git a/.github/workflows/release-rs.yml b/.github/workflows/release-rs.yml index de27458731d..3a984786c28 100644 --- a/.github/workflows/release-rs.yml +++ b/.github/workflows/release-rs.yml @@ -69,17 +69,7 @@ jobs: token: ${{ steps.generate-token.outputs.token }} # Install Nix for system dependencies (e.g. ffmpeg). - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter. `nixConfig` in flake.nix is - # untrusted by default, so nix logs "ignoring untrusted flake - # configuration setting 'extra-substituters'" and rebuilds from - # source anything missing from the public nixpkgs cache. Entering - # the dev shell costs ~12 minutes of uniffi-bindgen-go without it. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix # Its own scope rather than the shared store cache.yml warms: this holds # cargo-semver-checks rustdoc, not check and test artifacts, and mixing diff --git a/.github/workflows/ts.yml b/.github/workflows/ts.yml index de682c95480..52ceb2a30ba 100644 --- a/.github/workflows/ts.yml +++ b/.github/workflows/ts.yml @@ -57,12 +57,7 @@ jobs: with: tool-cache: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Rust cache uses: ./.github/actions/rust-cache diff --git a/.github/workflows/uring.yml b/.github/workflows/uring.yml index 6e0261b2248..94098da7352 100644 --- a/.github/workflows/uring.yml +++ b/.github/workflows/uring.yml @@ -48,12 +48,7 @@ jobs: with: tool-cache: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Rust cache uses: ./.github/actions/rust-cache diff --git a/.github/workflows/video.yml b/.github/workflows/video.yml index 6acf4b510d2..fb5c7db6c5d 100644 --- a/.github/workflows/video.yml +++ b/.github/workflows/video.yml @@ -49,14 +49,7 @@ jobs: with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, so the dev shell substitutes - # instead of building from source. See check.yml for the full story. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix # Playwright's Chromium isn't in the nix devShell. Install it plus its apt # runtime libs (`--with-deps` needs the host package manager); the recipe's diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index d28b6b076a9..35d607434f7 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -83,14 +83,7 @@ jobs: with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - # Trust the flake's cachix substituter, so the dev shell substitutes - # instead of building from source. See check.yml for the full story. - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix # cache.yml warms the default-branch store on `main`. Pull requests restore # it; the action refuses to publish from a pull request. diff --git a/.github/workflows/x11.yml b/.github/workflows/x11.yml index 3fa2200c924..7095d5a23c8 100644 --- a/.github/workflows/x11.yml +++ b/.github/workflows/x11.yml @@ -32,12 +32,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main - with: - determinate: false - extra-conf: | - extra-substituters = https://kixelated.cachix.org - extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk= + - uses: ./.github/actions/nix - name: Rust cache uses: ./.github/actions/rust-cache - name: Capture comparison diff --git a/doc/setup/install.md b/doc/setup/install.md index e653ee24bf5..4b5247a31db 100644 --- a/doc/setup/install.md +++ b/doc/setup/install.md @@ -67,8 +67,9 @@ docker run -i moqdev/moq --help Static binaries for Linux (x86\_64, aarch64), macOS (Apple Silicon), and Windows (x64) are attached to every [GitHub release](https://github.com/moq-dev/moq/releases). The Nix cache at -`kixelated.cachix.org` only holds tagged releases, so the `release` branch -builds from source. +`nix.moq.dev` only holds tagged releases, so the `release` branch builds from +source. Nix asks before trusting it; `--accept-flake-config` says yes for one +command. ## Debian and Ubuntu diff --git a/flake.nix b/flake.nix index 9b2cec8b694..4374c0ae178 100644 --- a/flake.nix +++ b/flake.nix @@ -1,19 +1,25 @@ { description = "MoQ - Media over QUIC"; - # Pre-built binaries live in our Cachix cache. Only tagged releases are - # pushed (CI fires on moq-relay-v*, moq-cli-v*, etc.), so pin the flake ref - # to a recent tag to get a hit. The default branch HEAD is not cached and - # builds from source: + # Pre-built binaries live in our binary cache at nix.moq.dev. Of the + # packages, only tagged releases are pushed (moq-relay-v*, moq-cli-v*, etc.), + # so pin the flake ref to a recent tag to get a hit. The default branch HEAD + # builds from source, though its dev shell is cached: # nix run github:moq-dev/moq/moq-relay-v0.12.4#moq-relay --accept-flake-config # # --accept-flake-config opts into the nixConfig below for one command. To - # trust the cache permanently instead, run: cachix use kixelated + # trust the cache permanently instead, add both settings to nix.conf. + # + # The dev shell paths expire 30 days after upload, possibly before a path + # that depends on them; `fallback` builds whatever is missing instead of + # failing the substitution. nixConfig = { - extra-substituters = [ "https://kixelated.cachix.org" ]; + extra-substituters = [ "https://nix.moq.dev" ]; extra-trusted-public-keys = [ - "kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk=" + # PLACEHOLDER until `just infra nix keygen` prints the real key. + "nix.moq.dev-1:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" ]; + fallback = true; }; inputs = { diff --git a/infra/README.md b/infra/README.md index dba5cb5e3aa..af68217988f 100644 --- a/infra/README.md +++ b/infra/README.md @@ -8,12 +8,14 @@ infrastructure. | `infra/apt` | `apt.moq.dev` | `apt-moq-dev` | Debian/Ubuntu package repository | | `infra/rpm` | `rpm.moq.dev` | `rpm-moq-dev` | Fedora/RHEL package repository | | `infra/moq-sh` | `moq.sh` | | The `moq` installer script | +| `infra/nix` | `nix.moq.dev` | `nix-moq-dev`, `nix-ci-moq-dev` | Nix binary cache | Each worker is a standalone bun package with a `wrangler.jsonc` and a small TypeScript handler. The apt and rpm workers proxy GETs out of the R2 bucket with appropriate `Content-Type` and `Cache-Control` headers for the -file kind. The moq.sh worker serves `install.sh` from its bundle at every path, -with the newest `moq-cli` release filled in as the default version. +file kind, and the nix worker does the same across its two buckets. The +moq.sh worker serves `install.sh` from its bundle at every path, with the +newest `moq-cli` release filled in as the default version. ## Deploying a worker @@ -23,6 +25,7 @@ From the repo root: just infra apt deploy just infra rpm deploy just infra moq-sh deploy +just infra nix deploy ``` Each recipe runs `bun install` and `bun wrangler deploy`. The @@ -131,3 +134,104 @@ Or trigger the GitHub Actions workflow manually: gh workflow run apt-repo.yml -f tag=moq-relay-v1.2.3 gh workflow run rpm-repo.yml -f tag=moq-relay-v1.2.3 ``` + +## Bootstrapping the Nix cache + +`nix.moq.dev` serves two buckets as one binary cache. `nix-moq-dev` holds +released packages, pushed by `release-nix.yml` on a release tag, and never +expires. `nix-ci-moq-dev` holds the dev shells `cache.yml` pushes from `main`, +and its lifecycle rule (`infra/nix/lifecycle.json`) deletes each object 30 +days after upload; the next warm re-uploads what it still needs. `flake.nix` +sets `fallback = true` because that expiry can remove a path before one that +depends on it. + +Nix only trusts paths signed by the key in `flake.nix`, so the signing key is +the trust boundary, not the bucket keys. It lives in two GitHub Environments: +`cache-write`, which only `main` can deploy to, and `nix-release`, which only +the five release tag patterns can. Readers need no secret. + +All of this runs once, by a maintainer, in this order: + +1. **Restrict the release tags.** Anyone with write access can push a tag + today, and `nix-release` admits any commit carrying one. Limit creating, + moving, and deleting them to moq-bot, the GitHub App release-plz tags + with, plus the role the `release` branch ruleset already lets bypass: + + ```bash + gh api -X POST repos/moq-dev/moq/rulesets --input - <<'EOF' + { + "name": "release tags", + "target": "tag", + "enforcement": "active", + "conditions": {"ref_name": {"exclude": [], "include": [ + "refs/tags/moq-relay-v*", "refs/tags/moq-cli-v*", "refs/tags/moq-boy-v*", + "refs/tags/moq-c-v*", "refs/tags/moq-gst-v*" + ]}}, + "rules": [{"type": "creation"}, {"type": "update"}, {"type": "deletion"}], + "bypass_actors": [ + {"actor_type": "Integration", "actor_id": 1039466, "bypass_mode": "always"}, + {"actor_type": "RepositoryRole", "actor_id": 2, "bypass_mode": "always"} + ] + } + EOF + ``` + +2. **Create the buckets and deploy the Worker** under your `wrangler login`: + + ```bash + just infra nix create # both buckets, plus the CI lifecycle rule + just infra nix deploy # nix.moq.dev + ``` + + After editing the rules, `just infra nix lifecycle` applies them. + +3. **Create the two Environments.** Name `main` rather than using a + protected-branches policy, which would admit `release` too. Skip + `cache-write` if the Rust build cache bootstrap already made it. + + ```bash + gh api -X PUT repos/moq-dev/moq/environments/cache-write --input - <<'EOF' + {"deployment_branch_policy": {"protected_branches": false, "custom_branch_policies": true}} + EOF + gh api -X POST repos/moq-dev/moq/environments/cache-write/deployment-branch-policies \ + -f name=main -f type=branch + + gh api -X PUT repos/moq-dev/moq/environments/nix-release --input - <<'EOF' + {"deployment_branch_policy": {"protected_branches": false, "custom_branch_policies": true}} + EOF + for tag in 'moq-relay-v*' 'moq-cli-v*' 'moq-boy-v*' 'moq-c-v*' 'moq-gst-v*'; do + gh api -X POST repos/moq-dev/moq/environments/nix-release/deployment-branch-policies \ + -f name="$tag" -f type=tag + done + ``` + +4. **Create two R2 API tokens** in the dashboard (R2 -> Manage API tokens -> + Create Account API token), each **Object Read & Write** on one bucket only. + Wrangler cannot create R2 tokens. Store each in its Environment: + + ```bash + # Scoped to nix-ci-moq-dev + gh secret set NIX_R2_ACCESS_KEY_ID --env cache-write --repo moq-dev/moq + gh secret set NIX_R2_SECRET_ACCESS_KEY --env cache-write --repo moq-dev/moq + + # Scoped to nix-moq-dev + gh secret set NIX_R2_ACCESS_KEY_ID --env nix-release --repo moq-dev/moq + gh secret set NIX_R2_SECRET_ACCESS_KEY --env nix-release --repo moq-dev/moq + ``` + +5. **Generate the signing key.** This stores it as `NIX_SIGNING_KEY` in both + Environments without writing it to disk, and prints the public key: + + ```bash + just infra nix keygen + ``` + + Put the printed `nix.moq.dev-1:...` key in `flake.nix`'s `nixConfig`. + +A job missing its secrets fails rather than skip the push. A job naming an +Environment that does not exist yet creates it with no deployment policy, so +if either workflow ran before step 3, check the policy before adding secrets. + +To rotate the key, run `keygen` again and add the new public key next to the +old one in `flake.nix`. Drop the old key once nothing signed with it matters: +30 days for CI paths, but never for released ones unless they are re-signed. diff --git a/infra/justfile b/infra/justfile index 513c5d6dc88..5deb2dfd412 100644 --- a/infra/justfile +++ b/infra/justfile @@ -3,9 +3,11 @@ set fallback mod apt mod rpm mod moq-sh +mod nix # Deploy all infra workers. deploy: just apt deploy just rpm deploy just moq-sh deploy + just nix deploy diff --git a/infra/nix/bun.lock b/infra/nix/bun.lock new file mode 100644 index 00000000000..c360c1dc66d --- /dev/null +++ b/infra/nix/bun.lock @@ -0,0 +1,241 @@ +{ + "lockfileVersion": 1, + "configVersion": 0, + "workspaces": { + "": { + "name": "nix-moq-dev", + "devDependencies": { + "@cloudflare/workers-types": "^5", + "typescript": "7.0.2", + "wrangler": "^4", + }, + }, + }, + "packages": { + "@cloudflare/kv-asset-handler": ["@cloudflare/kv-asset-handler@0.5.0", "", {}, "sha512-jxQYkj8dSIzc0cD6cMMNdOc1UVjqSqu8BZdor5s8cGjW2I8BjODt/kWPVdY+u9zj3ms75Q5qaZgnxUad83+eAg=="], + + "@cloudflare/unenv-preset": ["@cloudflare/unenv-preset@2.16.2", "", { "peerDependencies": { "unenv": "2.0.0-rc.24", "workerd": ">1.20260305.0 <2.0.0-0" }, "optionalPeers": ["workerd"] }, "sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ=="], + + "@cloudflare/workerd-darwin-64": ["@cloudflare/workerd-darwin-64@1.20261001.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-4cgSgDf28JSw/P5Dj5GCS59hzVqS5XnmGAWNkvYHLI6ODU9idGaMMNEuhJXDkEG/lsABmlVlnCgsdh2VbKWepw=="], + + "@cloudflare/workerd-darwin-arm64": ["@cloudflare/workerd-darwin-arm64@1.20261001.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-8ulAWruEVouNmEIsQsy9WSSCS9zkLu93W2MTwp5esiFyoPp05BNSVFIFsYSPi1pkFmBBd7fsnwMpbLkaJLaVPQ=="], + + "@cloudflare/workerd-linux-64": ["@cloudflare/workerd-linux-64@1.20261001.1", "", { "os": "linux", "cpu": "x64" }, "sha512-kZbTZJGrhsMOdqZ2BIybjaBRLZjYsRLWj7mcNw/6Y3hodOhp5MrNzcz4iWGwNVWwyIV+7Pl+/LX5VcgnRqdHOg=="], + + "@cloudflare/workerd-linux-arm64": ["@cloudflare/workerd-linux-arm64@1.20261001.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-oOk3Zj6k/8oP0FJgZBWDn7+BqbsqIMEMaV95pulHPVbwVu4wYoLfQq2hp0vkbCNsCFLqZb7cqixXdrwD54ZIow=="], + + "@cloudflare/workerd-windows-64": ["@cloudflare/workerd-windows-64@1.20261001.1", "", { "os": "win32", "cpu": "x64" }, "sha512-uRxm5W4VyBkoSaoP1BfOuH0873tE+vxsknF4sab6/5YIRvIAufChq3QDp+zlAn67PuGPGcn7W8QraA0t4ucmOQ=="], + + "@cloudflare/workers-types": ["@cloudflare/workers-types@5.20261004.1", "", {}, "sha512-K9D4/Y6bSIDNYFzjqzFMNoWK99pLgfgFxqSa76kfW++3VCkTSzJbzsQRffir366G3kmNyjoigC6ekp7DxIkxkw=="], + + "@cspotcode/source-map-support": ["@cspotcode/source-map-support@0.8.1", "", { "dependencies": { "@jridgewell/trace-mapping": "0.3.9" } }, "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw=="], + + "@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="], + + "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.28.1", "", { "os": "aix", "cpu": "ppc64" }, "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ=="], + + "@esbuild/android-arm": ["@esbuild/android-arm@0.28.1", "", { "os": "android", "cpu": "arm" }, "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ=="], + + "@esbuild/android-arm64": ["@esbuild/android-arm64@0.28.1", "", { "os": "android", "cpu": "arm64" }, "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg=="], + + "@esbuild/android-x64": ["@esbuild/android-x64@0.28.1", "", { "os": "android", "cpu": "x64" }, "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng=="], + + "@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.28.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q=="], + + "@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.28.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ=="], + + "@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.28.1", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw=="], + + "@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.28.1", "", { "os": "freebsd", "cpu": "x64" }, "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ=="], + + "@esbuild/linux-arm": ["@esbuild/linux-arm@0.28.1", "", { "os": "linux", "cpu": "arm" }, "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ=="], + + "@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.28.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g=="], + + "@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.28.1", "", { "os": "linux", "cpu": "ia32" }, "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w=="], + + "@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.28.1", "", { "os": "linux", "cpu": "none" }, "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg=="], + + "@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.28.1", "", { "os": "linux", "cpu": "none" }, "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ=="], + + "@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.28.1", "", { "os": "linux", "cpu": "ppc64" }, "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ=="], + + "@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.28.1", "", { "os": "linux", "cpu": "none" }, "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ=="], + + "@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.28.1", "", { "os": "linux", "cpu": "s390x" }, "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag=="], + + "@esbuild/linux-x64": ["@esbuild/linux-x64@0.28.1", "", { "os": "linux", "cpu": "x64" }, "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA=="], + + "@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.28.1", "", { "os": "none", "cpu": "arm64" }, "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw=="], + + "@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.28.1", "", { "os": "none", "cpu": "x64" }, "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg=="], + + "@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.28.1", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q=="], + + "@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.28.1", "", { "os": "openbsd", "cpu": "x64" }, "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw=="], + + "@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.28.1", "", { "os": "none", "cpu": "arm64" }, "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg=="], + + "@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.28.1", "", { "os": "sunos", "cpu": "x64" }, "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ=="], + + "@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.28.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA=="], + + "@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.28.1", "", { "os": "win32", "cpu": "ia32" }, "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg=="], + + "@esbuild/win32-x64": ["@esbuild/win32-x64@0.28.1", "", { "os": "win32", "cpu": "x64" }, "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A=="], + + "@img/colour": ["@img/colour@1.1.0", "", {}, "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ=="], + + "@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.3.3" }, "os": "darwin", "cpu": "arm64" }, "sha512-Uhfl4V4lhP2nbUVF9+hyH1+luj86f1gUFeo8ALYxFoULoU+G87D43BfeMP8XHsk9boxAnCY/bf2EHwhA7MuGsA=="], + + "@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.3.3" }, "os": "darwin", "cpu": "x64" }, "sha512-hWniXY3bG5qKpkKrAwPe4y+VTPmf086YQAnkxWh7uA1YrlRouWGa0M0Mxj3ZjnXFkv7/TD1bTy9lGUK26vRvWw=="], + + "@img/sharp-freebsd-wasm32": ["@img/sharp-freebsd-wasm32@0.35.4", "", { "dependencies": { "@img/sharp-wasm32": "0.35.4" }, "os": "freebsd" }, "sha512-lIsKw/BU+kjB4eZjxrYrZmwOJYi3Ajrv66iAlBmUPyKc3HpnloevB1g3wxGD9P/5BbQ1brBGl65VRRrCvQDEqA=="], + + "@img/sharp-libvips-darwin-arm64": ["@img/sharp-libvips-darwin-arm64@1.3.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-suTBPTDGrI9WodccaDdwZItTSaBYASlBk1NSfElSHrUfzu3szG6lvIF58+WiFvnfzuK8ZBFS5zE00PxqxnRiPg=="], + + "@img/sharp-libvips-darwin-x64": ["@img/sharp-libvips-darwin-x64@1.3.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-FVJZ5mITMobmXIz/hPDTw0EintTW5H3WfrxwLqEqjiIihlu+hVRyGrFQ60xl0Lxn7Bt3zdpevPaQi0HEzqz9fw=="], + + "@img/sharp-libvips-linux-arm": ["@img/sharp-libvips-linux-arm@1.3.3", "", { "os": "linux", "cpu": "arm" }, "sha512-3rbU4vqXXc3hY/OiXdl52xZvT0F1yEngWfvqudtPJg/KkyiaQw2DRsFrNzpmLvfavbwOq3qXn36GP8obHRULQA=="], + + "@img/sharp-libvips-linux-arm64": ["@img/sharp-libvips-linux-arm64@1.3.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-0DaL0A6Xu6sQSQFwe4iVCrKWU2cCTItnRsYsCdxAMm9NF6twAA9BKnoqy4hqz4+azQ0JHuA26qiUKsf1XJ/v5A=="], + + "@img/sharp-libvips-linux-ppc64": ["@img/sharp-libvips-linux-ppc64@1.3.3", "", { "os": "linux", "cpu": "ppc64" }, "sha512-cdn1OvUBwsXhbC0zSzJnNzf5MZ/mTrobawDvNXBTxe8VtqKAm0sRuEY2Evzovb/w9JMk4TvRxqt1mekSuJz64w=="], + + "@img/sharp-libvips-linux-riscv64": ["@img/sharp-libvips-linux-riscv64@1.3.3", "", { "os": "linux", "cpu": "none" }, "sha512-HjPVx7yKz+0lqdhDlTw1tt90wamBoxhiXpvl1XZpJLiHH4RCJ5yDTqH+VlYPv2fwFs89JFw4c1IexYOcQUi4IQ=="], + + "@img/sharp-libvips-linux-s390x": ["@img/sharp-libvips-linux-s390x@1.3.3", "", { "os": "linux", "cpu": "s390x" }, "sha512-neWLh+3yCNThxnfy3c4BbVBeGgt9aftno+XbT56iK28RgeDs3UOFWviLWlUu0bArYVYJaFDK+RRohbicUNCm8Q=="], + + "@img/sharp-libvips-linux-x64": ["@img/sharp-libvips-linux-x64@1.3.3", "", { "os": "linux", "cpu": "x64" }, "sha512-4vKmvAst9nrowcqquKFAyZJUDolUaIp8uRiN0mWFguJ1IplC9/pitXtlnnlU4aa/eJw3J7i67V+pwUL+wZGdsA=="], + + "@img/sharp-libvips-linuxmusl-arm64": ["@img/sharp-libvips-linuxmusl-arm64@1.3.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-Y9kQaLMuNoB0bPYOOdcZMaseNrFpPodIWWMrx+CZyydf2xn68j9WYc6sWWRrDwNkzCQjKYfc68L7jKjGlHMibw=="], + + "@img/sharp-libvips-linuxmusl-x64": ["@img/sharp-libvips-linuxmusl-x64@1.3.3", "", { "os": "linux", "cpu": "x64" }, "sha512-fj8Mv0HHfD1Rr+4I68+3agJynxDWtBFgicTbSOb9Bke6pIwzGcJ+RX/yHjmiEGFMCavY/dxvem7MyNaJF+wDiw=="], + + "@img/sharp-linux-arm": ["@img/sharp-linux-arm@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.3.3" }, "os": "linux", "cpu": "arm" }, "sha512-7OAS8gI0EReKGVN2HssHlM6umJgxF5VI3xN0p9FA91p/YO+ou5hiNghLdZ5BEHztwaaK5+bLKRf8x/o2L2nk9A=="], + + "@img/sharp-linux-arm64": ["@img/sharp-linux-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.3.3" }, "os": "linux", "cpu": "arm64" }, "sha512-De4jpEnAU8Hd5oT0j1G3uL4ZvTuipVMn7YC6vPaJhy6/7EwEae0SVAoBrUMYQbkLGDm85taVWwuPc1a44LTzCQ=="], + + "@img/sharp-linux-ppc64": ["@img/sharp-linux-ppc64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-ppc64": "1.3.3" }, "os": "linux", "cpu": "ppc64" }, "sha512-2oYZJeIl4kCcMGk4ouZVjnkCtFrpQFlNEtJ6GbxzhHQchwH0NH/qEb9ykmOl29dqwMq+JhFdZn+1ak2FKhI9fQ=="], + + "@img/sharp-linux-riscv64": ["@img/sharp-linux-riscv64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-riscv64": "1.3.3" }, "os": "linux", "cpu": "none" }, "sha512-cPbNChoRURAWdebDIHSenxRpgEdy7JkPydSnUxRm9VvKD7m0/xVaR/8Fzlu81pk5nHEvHH87UZUA7cTtwnbJSA=="], + + "@img/sharp-linux-s390x": ["@img/sharp-linux-s390x@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.3.3" }, "os": "linux", "cpu": "s390x" }, "sha512-RY0JFY8Fd6RonCBtHz+DvadaPkXDSI1AUn6yWL9TipqkZ1vY8w8evqdgyDFnkm4/K1ve1TvZiaePP5oSd4+WVQ=="], + + "@img/sharp-linux-x64": ["@img/sharp-linux-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.3.3" }, "os": "linux", "cpu": "x64" }, "sha512-9qvvEAuk8k89TfWUoX2htWjbAMX8p+NxCppjpcg5k6xMsjhBQPTsoIh36h9Qde4WRuGpJeYnOjdosDn/cnv+OA=="], + + "@img/sharp-linuxmusl-arm64": ["@img/sharp-linuxmusl-arm64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.3.3" }, "os": "linux", "cpu": "arm64" }, "sha512-KB5jxpfWQTr0nc3xdHtWChdbifHrBGsd2SM62Eyxrl8afikm+f5qGBU75SJIZBT/S1MC8XyacdlXBMSWq6OURA=="], + + "@img/sharp-linuxmusl-x64": ["@img/sharp-linuxmusl-x64@0.35.4", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.3.3" }, "os": "linux", "cpu": "x64" }, "sha512-f+eZJZIQNEEd26RPSW+76chwOf1XtA2Y/O+5ocVyLliHkeih3e+jhLVBdNTd2rS3IbNXK8+ug93Vf5ZXtF5Lxg=="], + + "@img/sharp-wasm32": ["@img/sharp-wasm32@0.35.4", "", { "dependencies": { "@emnapi/runtime": "^1.11.3" } }, "sha512-zQnl4Kwp7Q6NHsENtU2T/00Zi+w3AQNwz3+UaTyVBy2FpXrzXzGjndpK61onhZjRtRpQXxCTeqw19bVyXOh7jA=="], + + "@img/sharp-webcontainers-wasm32": ["@img/sharp-webcontainers-wasm32@0.35.4", "", { "dependencies": { "@img/sharp-wasm32": "0.35.4" }, "cpu": "none" }, "sha512-ESfNkywmCfPNyaZjxooddJQiQ+l/nTpGEOGthxiLnIHXC/CmcBixnfwUleX9mCz9ovrUUvKMap/pm8RYbzfwaA=="], + + "@img/sharp-win32-arm64": ["@img/sharp-win32-arm64@0.35.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-iNdlBX9gLVvqe2I3uIJSIKTq6wckP/DYxZtcqxm09x5Gi24DnFBmPAWZmr60ZyYMG0xlzo6goG3670ar+RXvRw=="], + + "@img/sharp-win32-ia32": ["@img/sharp-win32-ia32@0.35.4", "", { "os": "win32", "cpu": "ia32" }, "sha512-kqRsbaa5CS6KHlpxnN7WhE6vAAugXyZButpRdvDWetlv6Qv4N9WTcrWzF7tXfB9T7MsoadqdI8hmwLq6UlLvtw=="], + + "@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.35.4", "", { "os": "win32", "cpu": "x64" }, "sha512-XtmnYhBcrORsJ4XJngyzr/EWP0hRZLAZRFaApdKuviyqF78+ylxh2y06ZmtULAMOnObJ3ucpN0AcwSWnMowTRg=="], + + "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], + + "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="], + + "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.9", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ=="], + + "@poppinss/colors": ["@poppinss/colors@4.1.6", "", { "dependencies": { "kleur": "^4.1.5" } }, "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg=="], + + "@poppinss/dumper": ["@poppinss/dumper@0.6.5", "", { "dependencies": { "@poppinss/colors": "^4.1.5", "@sindresorhus/is": "^7.0.2", "supports-color": "^10.0.0" } }, "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw=="], + + "@poppinss/exception": ["@poppinss/exception@1.2.3", "", {}, "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw=="], + + "@sindresorhus/is": ["@sindresorhus/is@7.2.0", "", {}, "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw=="], + + "@speed-highlight/core": ["@speed-highlight/core@1.2.15", "", {}, "sha512-BMq1K3DsElxDWawkX6eLg9+CKJrTVGCBAWVuHXVUV2u0s2711qiChLSId6ikYPfxhdYocLNt3wWwSvDiTvFabw=="], + + "@typescript/typescript-aix-ppc64": ["@typescript/typescript-aix-ppc64@7.0.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ=="], + + "@typescript/typescript-darwin-arm64": ["@typescript/typescript-darwin-arm64@7.0.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA=="], + + "@typescript/typescript-darwin-x64": ["@typescript/typescript-darwin-x64@7.0.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA=="], + + "@typescript/typescript-freebsd-arm64": ["@typescript/typescript-freebsd-arm64@7.0.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ=="], + + "@typescript/typescript-freebsd-x64": ["@typescript/typescript-freebsd-x64@7.0.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw=="], + + "@typescript/typescript-linux-arm": ["@typescript/typescript-linux-arm@7.0.2", "", { "os": "linux", "cpu": "arm" }, "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ=="], + + "@typescript/typescript-linux-arm64": ["@typescript/typescript-linux-arm64@7.0.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ=="], + + "@typescript/typescript-linux-loong64": ["@typescript/typescript-linux-loong64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ=="], + + "@typescript/typescript-linux-mips64el": ["@typescript/typescript-linux-mips64el@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA=="], + + "@typescript/typescript-linux-ppc64": ["@typescript/typescript-linux-ppc64@7.0.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA=="], + + "@typescript/typescript-linux-riscv64": ["@typescript/typescript-linux-riscv64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ=="], + + "@typescript/typescript-linux-s390x": ["@typescript/typescript-linux-s390x@7.0.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw=="], + + "@typescript/typescript-linux-x64": ["@typescript/typescript-linux-x64@7.0.2", "", { "os": "linux", "cpu": "x64" }, "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A=="], + + "@typescript/typescript-netbsd-arm64": ["@typescript/typescript-netbsd-arm64@7.0.2", "", { "os": "none", "cpu": "arm64" }, "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA=="], + + "@typescript/typescript-netbsd-x64": ["@typescript/typescript-netbsd-x64@7.0.2", "", { "os": "none", "cpu": "x64" }, "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA=="], + + "@typescript/typescript-openbsd-arm64": ["@typescript/typescript-openbsd-arm64@7.0.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ=="], + + "@typescript/typescript-openbsd-x64": ["@typescript/typescript-openbsd-x64@7.0.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg=="], + + "@typescript/typescript-sunos-x64": ["@typescript/typescript-sunos-x64@7.0.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g=="], + + "@typescript/typescript-win32-arm64": ["@typescript/typescript-win32-arm64@7.0.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ=="], + + "@typescript/typescript-win32-x64": ["@typescript/typescript-win32-x64@7.0.2", "", { "os": "win32", "cpu": "x64" }, "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g=="], + + "blake3-wasm": ["blake3-wasm@2.1.5", "", {}, "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g=="], + + "cookie": ["cookie@1.1.1", "", {}, "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ=="], + + "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + + "error-stack-parser-es": ["error-stack-parser-es@1.0.5", "", {}, "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA=="], + + "esbuild": ["esbuild@0.28.1", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.1", "@esbuild/android-arm": "0.28.1", "@esbuild/android-arm64": "0.28.1", "@esbuild/android-x64": "0.28.1", "@esbuild/darwin-arm64": "0.28.1", "@esbuild/darwin-x64": "0.28.1", "@esbuild/freebsd-arm64": "0.28.1", "@esbuild/freebsd-x64": "0.28.1", "@esbuild/linux-arm": "0.28.1", "@esbuild/linux-arm64": "0.28.1", "@esbuild/linux-ia32": "0.28.1", "@esbuild/linux-loong64": "0.28.1", "@esbuild/linux-mips64el": "0.28.1", "@esbuild/linux-ppc64": "0.28.1", "@esbuild/linux-riscv64": "0.28.1", "@esbuild/linux-s390x": "0.28.1", "@esbuild/linux-x64": "0.28.1", "@esbuild/netbsd-arm64": "0.28.1", "@esbuild/netbsd-x64": "0.28.1", "@esbuild/openbsd-arm64": "0.28.1", "@esbuild/openbsd-x64": "0.28.1", "@esbuild/openharmony-arm64": "0.28.1", "@esbuild/sunos-x64": "0.28.1", "@esbuild/win32-arm64": "0.28.1", "@esbuild/win32-ia32": "0.28.1", "@esbuild/win32-x64": "0.28.1" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw=="], + + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + + "kleur": ["kleur@4.1.5", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="], + + "miniflare": ["miniflare@5.20261001.0-alpha", "", { "dependencies": { "@cspotcode/source-map-support": "0.8.1", "sharp": "0.35.4", "undici": "7.29.1", "workerd": "1.20261001.1", "ws": "8.21.0", "youch": "4.1.0-beta.10" } }, "sha512-GaimS5mSIOMyvd16ga+e1/QkI8cmp3z35QPHFex0DktqNQf2RVZQwMPQXdyoUreUiFP/0Gpe2MoQInTyMAD5xA=="], + + "path-to-regexp": ["path-to-regexp@6.3.0", "", {}, "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ=="], + + "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], + + "semver": ["semver@7.8.5", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="], + + "sharp": ["sharp@0.35.4", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.4", "@img/sharp-darwin-x64": "0.35.4", "@img/sharp-freebsd-wasm32": "0.35.4", "@img/sharp-libvips-darwin-arm64": "1.3.3", "@img/sharp-libvips-darwin-x64": "1.3.3", "@img/sharp-libvips-linux-arm": "1.3.3", "@img/sharp-libvips-linux-arm64": "1.3.3", "@img/sharp-libvips-linux-ppc64": "1.3.3", "@img/sharp-libvips-linux-riscv64": "1.3.3", "@img/sharp-libvips-linux-s390x": "1.3.3", "@img/sharp-libvips-linux-x64": "1.3.3", "@img/sharp-libvips-linuxmusl-arm64": "1.3.3", "@img/sharp-libvips-linuxmusl-x64": "1.3.3", "@img/sharp-linux-arm": "0.35.4", "@img/sharp-linux-arm64": "0.35.4", "@img/sharp-linux-ppc64": "0.35.4", "@img/sharp-linux-riscv64": "0.35.4", "@img/sharp-linux-s390x": "0.35.4", "@img/sharp-linux-x64": "0.35.4", "@img/sharp-linuxmusl-arm64": "0.35.4", "@img/sharp-linuxmusl-x64": "0.35.4", "@img/sharp-webcontainers-wasm32": "0.35.4", "@img/sharp-win32-arm64": "0.35.4", "@img/sharp-win32-ia32": "0.35.4", "@img/sharp-win32-x64": "0.35.4" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA=="], + + "supports-color": ["supports-color@10.2.2", "", {}, "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g=="], + + "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + + "typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="], + + "undici": ["undici@7.29.1", "", {}, "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q=="], + + "unenv": ["unenv@2.0.0-rc.24", "", { "dependencies": { "pathe": "^2.0.3" } }, "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw=="], + + "workerd": ["workerd@1.20261001.1", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20261001.1", "@cloudflare/workerd-darwin-arm64": "1.20261001.1", "@cloudflare/workerd-linux-64": "1.20261001.1", "@cloudflare/workerd-linux-arm64": "1.20261001.1", "@cloudflare/workerd-windows-64": "1.20261001.1" }, "bin": { "workerd": "bin/workerd" } }, "sha512-d/SIYHFO0PT/wiFZg8in4NpRIxYuFwslX1HdylOtWkBIIUmSpkGFhK820cV84XACFylwJ48xuRoWW/8DWDPsPQ=="], + + "wrangler": ["wrangler@4.147.0", "", { "dependencies": { "@cloudflare/kv-asset-handler": "0.5.0", "@cloudflare/unenv-preset": "2.16.2", "blake3-wasm": "2.1.5", "esbuild": "0.28.1", "miniflare": "5.20261001.0-alpha", "path-to-regexp": "6.3.0", "unenv": "2.0.0-rc.24", "workerd": "1.20261001.1" }, "optionalDependencies": { "fsevents": "2.3.3" }, "peerDependencies": { "@cloudflare/workers-types": "^5.20261001.1" }, "optionalPeers": ["@cloudflare/workers-types"], "bin": { "wrangler": "bin/wrangler.js", "wrangler2": "bin/wrangler.js", "cf-wrangler": "bin/cf-wrangler.js" } }, "sha512-pQYRoiq8PTAxphaG69z8+GC1DkSGd19EDZehQ8zxjo/Ko3mRB6Qs1mTrd8ZuKAarLklIjTqr1lUdCK9r4q2hUg=="], + + "ws": ["ws@8.21.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g=="], + + "youch": ["youch@4.1.0-beta.10", "", { "dependencies": { "@poppinss/colors": "^4.1.5", "@poppinss/dumper": "^0.6.4", "@speed-highlight/core": "^1.2.7", "cookie": "^1.0.2", "youch-core": "^0.3.3" } }, "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ=="], + + "youch-core": ["youch-core@0.3.3", "", { "dependencies": { "@poppinss/exception": "^1.2.2", "error-stack-parser-es": "^1.0.5" } }, "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA=="], + } +} diff --git a/infra/nix/justfile b/infra/nix/justfile new file mode 100644 index 00000000000..ca539813f52 --- /dev/null +++ b/infra/nix/justfile @@ -0,0 +1,44 @@ +set fallback + +# Deploy the nix.moq.dev worker. +deploy: + bun install --frozen-lockfile + bun wrangler deploy + +# Create the release and CI R2 buckets and the CI bucket's lifecycle rule. Run once. +create: + bun install --frozen-lockfile + bun wrangler r2 bucket create nix-moq-dev + bun wrangler r2 bucket create nix-ci-moq-dev + just lifecycle + +# Replace the CI bucket's lifecycle rules with lifecycle.json. +lifecycle: + bun install --frozen-lockfile + bun wrangler r2 bucket lifecycle set nix-ci-moq-dev --file lifecycle.json --force + +# Sign store paths and upload them, with their closures, to a nix.moq.dev bucket. +[no-cd] +push bucket +paths: + #!/usr/bin/env bash + set -euo pipefail + # The R2 token must be scoped to that bucket. `nix copy` skips any path the + # bucket already has. + : "${NIX_SIGNING_KEY:?not set; the job needs the cache-write or nix-release Environment}" + : "${AWS_ACCESS_KEY_ID:?not set}" + : "${AWS_SECRET_ACCESS_KEY:?not set}" + key=$(mktemp) + trap 'rm -f "$key"' EXIT + printf '%s' "$NIX_SIGNING_KEY" >"$key" + nix copy --to "s3://{{ bucket }}?endpoint=dd618f5dbd5da77b8296f1613c301f5c.r2.cloudflarestorage.com®ion=auto&compression=zstd&secret-key=$key" {{ paths }} + +# Generate a signing key into both Environments and print its public half for flake.nix. +keygen: + #!/usr/bin/env bash + set -euo pipefail + key=$(nix key generate-secret --key-name nix.moq.dev-1) + for env in cache-write nix-release; do + printf '%s' "$key" | gh secret set NIX_SIGNING_KEY --env "$env" --repo moq-dev/moq + done + printf '%s' "$key" | nix key convert-secret-to-public + echo diff --git a/infra/nix/lifecycle.json b/infra/nix/lifecycle.json new file mode 100644 index 00000000000..bea0ce7f613 --- /dev/null +++ b/infra/nix/lifecycle.json @@ -0,0 +1,10 @@ +{ + "rules": [ + { + "id": "expire", + "enabled": true, + "conditions": { "prefix": "" }, + "deleteObjectsTransition": { "condition": { "type": "Age", "maxAge": 2592000 } } + } + ] +} diff --git a/infra/nix/package.json b/infra/nix/package.json new file mode 100644 index 00000000000..23b28066691 --- /dev/null +++ b/infra/nix/package.json @@ -0,0 +1,12 @@ +{ + "name": "nix-moq-dev", + "private": true, + "scripts": { + "deploy": "wrangler deploy" + }, + "devDependencies": { + "@cloudflare/workers-types": "^5", + "typescript": "7.0.2", + "wrangler": "^4" + } +} diff --git a/infra/nix/src/worker.ts b/infra/nix/src/worker.ts new file mode 100644 index 00000000000..970bdd53031 --- /dev/null +++ b/infra/nix/src/worker.ts @@ -0,0 +1,73 @@ +// Cloudflare Worker for nix.moq.dev, the project's Nix binary cache. Serves two +// R2 buckets as one cache, written by infra/nix/push.sh through `nix copy`: +// +// nix-moq-dev released packages, kept forever +// nix-ci-moq-dev CI dev shells, expired by a lifecycle rule +// +// /nix-cache-info cache metadata, answered here +// /.narinfo signed path metadata, pointing into nar/ +// /nar/.nar.zst compressed archive, named by its own hash + +interface Env { + RELEASE: R2Bucket; + CI: R2Bucket; +} + +// Priority 41 puts this right after cache.nixos.org (40), so Nix only asks here +// for paths nixpkgs doesn't serve. Answered here rather than from a bucket so +// the two can't disagree. +const CACHE_INFO = "StoreDir: /nix/store\nWantMassQuery: 1\nPriority: 41\n"; + +function contentType(key: string): string { + if (key.endsWith(".narinfo")) return "text/x-nix-narinfo"; + if (key.startsWith("nar/")) return "application/x-nix-nar"; + return "application/octet-stream"; +} + +// A NAR is named by the hash of its bytes, so it never changes. A narinfo +// stays short so a path the CI lifecycle rule deletes stops being advertised +// soon after. +function cacheControl(key: string): string { + if (key.startsWith("nar/")) { + return "public, max-age=31536000, immutable"; + } + return "public, max-age=300"; +} + +export default { + async fetch(request: Request, env: Env): Promise { + if (request.method !== "GET" && request.method !== "HEAD") { + return new Response("Method Not Allowed", { status: 405 }); + } + + const key = new URL(request.url).pathname.slice(1); + + if (key === "nix-cache-info") { + return new Response(request.method === "HEAD" ? null : CACHE_INFO, { + headers: { "Content-Type": "text/x-nix-cache-info", "Cache-Control": "public, max-age=3600" }, + }); + } + + if (!key) { + return new Response("MoQ Nix binary cache. See https://moq.dev/setup/install for usage.\n", { + headers: { "Content-Type": "text/plain; charset=utf-8" }, + }); + } + + // Releases first, since they never expire. A NAR is named by its hash, so + // whichever bucket holds it serves the same bytes. + for (const bucket of [env.RELEASE, env.CI]) { + const object = await bucket.get(key); + if (!object) continue; + + const headers = { + "Content-Type": contentType(key), + "Cache-Control": cacheControl(key), + "Content-Length": object.size.toString(), + }; + return new Response(request.method === "HEAD" ? null : object.body, { headers }); + } + + return new Response("Not Found", { status: 404 }); + }, +}; diff --git a/infra/nix/wrangler.jsonc b/infra/nix/wrangler.jsonc new file mode 100644 index 00000000000..3b7c4e50280 --- /dev/null +++ b/infra/nix/wrangler.jsonc @@ -0,0 +1,34 @@ +{ + // Cloudflare Wrangler configuration for the Nix binary cache worker. + // Serves nix.moq.dev from two R2 buckets: released packages, kept forever, + // and CI dev shells, which a lifecycle rule expires. + "$schema": "node_modules/wrangler/config-schema.json", + "name": "nix-moq-dev", + "main": "src/worker.ts", + "compatibility_date": "2025-07-09", + "account_id": "dd618f5dbd5da77b8296f1613c301f5c", + "workers_dev": false, + "route": { + "pattern": "nix.moq.dev", + "custom_domain": true + }, + // R2 bucket bindings + "r2_buckets": [ + { + "binding": "RELEASE", + "bucket_name": "nix-moq-dev", + "remote": true + }, + { + "binding": "CI", + "bucket_name": "nix-ci-moq-dev", + "remote": true + } + ], + // Observability + "observability": { + "logs": { + "enabled": true + } + } +} diff --git a/nix/overlay.nix b/nix/overlay.nix index 19424f7b165..c7f7e3ffc4a 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -66,7 +66,7 @@ let src = cleanCargoSource; cargoExtraArgs = "-p moq-relay --features jemalloc"; # Enable frame pointers for profiling support (negligible overhead on x86_64). - # This also ensures the CDN build matches what Cachix caches. + # This also ensures the CDN build matches what nix.moq.dev caches. RUSTFLAGS = "-C force-frame-pointers=yes"; # jemalloc's configure uses -O0 test builds, which conflict with # Nix's _FORTIFY_SOURCE hardening (requires -O). @@ -219,7 +219,7 @@ let ''; # The flake output is meant to load against nix's GStreamer (in a - # `nix shell .#moq-gst` / cachix-pulled context). `/nix/store` refs + # `nix shell .#moq-gst` / binary-cache-pulled context). `/nix/store` refs # are correct there. The only thing we fix is the rustc-emitted # self-reference to /nix/var/nix/builds/.../libgstmoq.dylib (the # cargo build dir, gone post-build) which would break loading even diff --git a/quest/m0/ci/README.md b/quest/m0/ci/README.md index 1b311c5a471..b0efc192925 100644 --- a/quest/m0/ci/README.md +++ b/quest/m0/ci/README.md @@ -68,5 +68,5 @@ The historical samples locate candidates; they are not controlled benchmarks. - [Reduce setup cost](/quest/m0/ci/setup-cost.md) - select cleanup and setup from actual workload needs - [Require platform gates](/quest/m0/ci/platform-queue.md) - activate the consolidated platform checks in the main and release rulesets after the workflow lands - [mbx on R2](/quest/m0/ci/mbx-r2.md) - Rust builds on every OS read an R2 cache that only `main` writes, escaping the 10 GB Actions cache -- [Nix cache](/quest/m0/ci/nix-cache.md) - `nix.moq.dev` on R2 replaces Cachix for CI and releases +- [Verify the Nix cache](/quest/m0/ci/nix-cache-verify.md) - condition: the maintainer bootstrap; then confirm CI and releases use `nix.moq.dev` and retire Cachix - [Nightly after FFI reuse](/quest/m0/ci/nightly-ffi-reuse.md) - condition: the first scheduled Nightly and `moq-ffi-v*` tag after #5549 and #5527; measure them and verify the shared build diff --git a/quest/m0/ci/nix-cache-verify.md b/quest/m0/ci/nix-cache-verify.md new file mode 100644 index 00000000000..6a175a5dcdf --- /dev/null +++ b/quest/m0/ci/nix-cache-verify.md @@ -0,0 +1,27 @@ +# [S] Verify the Nix cache + +## Goal + +Condition: a maintainer has run the `nix.moq.dev` bootstrap in +`infra/README.md` (the release tag ruleset, both buckets and the Worker, the +`cache-write` and `nix-release` Environments and their secrets, and the +signing key), and the PR that wired it in has merged with the real public key +in `flake.nix`. Check it with `curl https://nix.moq.dev/nix-cache-info` and +`gh run list --workflow cache.yml --branch main`. + +Then confirm it, and record the numbers in the PR that closes this: + +- The first `main` warm pushes the dev shell, and a later pull request job + enters `nix develop` without compiling uniffi-bindgen-go. +- The next `moq-relay-v*` or `moq-cli-v*` tag pushes from all three + `release-nix.yml` legs, and `nix run github:moq-dev/moq/#moq-relay + --accept-flake-config` substitutes on a clean machine. +- Dev shell upload time and both bucket sizes after a month, against the + 30-day expiry in `infra/nix/lifecycle.json`. Switch to a closure-aware + collector (niks3) only if expiry makes CI fall back to source builds often. +- Delete the `CACHIX_AUTH_TOKEN` secret and the `kixelated` Cachix cache once + the maintainer decides downstream flakes have had long enough to switch. + +## Related + +- [CI cost and latency](/quest/m0/ci/README.md) - the R2 and Environment decisions this verifies diff --git a/quest/m0/ci/nix-cache.md b/quest/m0/ci/nix-cache.md deleted file mode 100644 index 7a2bad22f28..00000000000 --- a/quest/m0/ci/nix-cache.md +++ /dev/null @@ -1,37 +0,0 @@ -# [M] nix.moq.dev replaces Cachix - -## Goal - -`https://nix.moq.dev` is the project's Nix binary cache, served from R2. CI -jobs substitute the dev shells from it, release workflows push the released -packages to it, and `flake.nix` and every workflow name it instead of -`kixelated.cachix.org`. Only workflows on `main` or a release tag can sign -and push. - -## Plan - -- Cachix's open-source plan is 5 GB and evicts the oldest paths, which the - dev shell closures plus three-platform release builds outgrow. R2 has no - such cap and no egress charge. -- Nix verifies signatures, so the signing key, not the bucket key, is the - trust boundary. Keep it and the bucket key in GitHub Environments that - `main` and the release tags can deploy from, and nothing else. Release tags - are unprotected today (no tag ruleset), so restricting who can create them - comes first; a separate release Environment from the mbx one is fine. A - leaked bucket key cannot make a client accept a path. -- Serve the bucket like apt and rpm: a Worker in `infra/nix` with a checked-in - `wrangler.jsonc` and custom domain, cache headers suited to `.narinfo` - (short) and `nar/` (immutable). Bucket and lifecycle are one-time commands - in `infra/README.md`. -- Expiry by object age can delete a dependency before its dependent. Clients - should set `fallback = true` and the warmer re-pushes what it needs; switch - to a closure-aware collector (niks3) only if that proves noisy. -- Downstream flakes that trust `kixelated.cachix.org` for released packages - keep working until they update; decide with the maintainer how long Cachix - keeps receiving release pushes. -- The cache warmer's dev shell push and the Cachix release workflow both move - over. - -## Related - -- [mbx on R2](/quest/m0/ci/mbx-r2.md) - shares the Environment and bootstrap pattern, not the bucket diff --git a/rs/moq-gst/scrub.sh b/rs/moq-gst/scrub.sh index 09ec56ad34a..f5024900794 100755 --- a/rs/moq-gst/scrub.sh +++ b/rs/moq-gst/scrub.sh @@ -4,7 +4,7 @@ # the user's system GStreamer instead of the nix copy it was linked # against. Used by build.sh on the tarball / .deb / .rpm release path; # `nix build .#moq-gst` does not run this, so the flake output stays -# usable inside `nix shell` / cachix. +# usable inside `nix shell` / the binary cache. # # Usage: # scrub.sh From 77b003e1dbbad46e84c8208ca9489ade21dc58ce Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 19 Oct 2026 21:21:22 -0700 Subject: [PATCH 3/4] ci: sign nix.moq.dev with the real key from one Environment flake.nix now trusts the generated nix.moq.dev-1 key instead of the all-zero placeholder. With one signing key, a second Environment for releases only guarded the bucket token: anything reaching the key can sign any path. So release-nix deploys to cache-write, which also admits the release tags, and one R2 token covers both buckets. keygen writes only there, and bucket creation no longer offers to add bindings to wrangler.jsonc. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release-nix.yml | 8 +++--- flake.nix | 3 +-- infra/README.md | 44 +++++++++++-------------------- infra/nix/justfile | 15 +++++------ quest/m0/ci/nix-cache-verify.md | 2 +- 5 files changed, 28 insertions(+), 44 deletions(-) diff --git a/.github/workflows/release-nix.yml b/.github/workflows/release-nix.yml index f76c4b993d4..0ad7246d56d 100644 --- a/.github/workflows/release-nix.yml +++ b/.github/workflows/release-nix.yml @@ -3,9 +3,9 @@ name: Release Nix # Pushes each released package to nix.moq.dev, so `nix run` on a release tag # substitutes it instead of building from source. # -# The signing key and the release bucket's write key live in the -# `nix-release` Environment, which only these tag patterns can deploy from. A -# tag ruleset limits who can create them; see infra/README.md. +# The signing key and the bucket write key live in the `cache-write` +# Environment, which only `main`, the merge queue, and these tag patterns can +# deploy from. A tag ruleset limits who can create them; see infra/README.md. on: push: @@ -22,7 +22,7 @@ jobs: release: name: Release (${{ matrix.runs-on }}) runs-on: ${{ matrix.runs-on }} - environment: nix-release + environment: cache-write permissions: contents: read strategy: diff --git a/flake.nix b/flake.nix index d8cc6ba728f..4154ab9f3e6 100644 --- a/flake.nix +++ b/flake.nix @@ -16,8 +16,7 @@ nixConfig = { extra-substituters = [ "https://nix.moq.dev" ]; extra-trusted-public-keys = [ - # PLACEHOLDER until `just infra nix keygen` prints the real key. - "nix.moq.dev-1:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + "nix.moq.dev-1:BZ0DtCypDFv1ESX3hxuB42yc0vitSA1YHojSmVwB5bk=" ]; fallback = true; }; diff --git a/infra/README.md b/infra/README.md index af68217988f..28f8e3adb2e 100644 --- a/infra/README.md +++ b/infra/README.md @@ -146,14 +146,16 @@ sets `fallback = true` because that expiry can remove a path before one that depends on it. Nix only trusts paths signed by the key in `flake.nix`, so the signing key is -the trust boundary, not the bucket keys. It lives in two GitHub Environments: -`cache-write`, which only `main` can deploy to, and `nix-release`, which only -the five release tag patterns can. Readers need no secret. +the trust boundary, not the bucket keys. It lives in the `cache-write` +Environment beside one R2 token for both buckets. Only `main`, the merge queue, +and the five release tag patterns can deploy there; anything that can reach +the key can sign any path, so a second Environment for releases would only +guard the bucket. Readers need no secret. All of this runs once, by a maintainer, in this order: 1. **Restrict the release tags.** Anyone with write access can push a tag - today, and `nix-release` admits any commit carrying one. Limit creating, + today, and `cache-write` admits any commit carrying one. Limit creating, moving, and deleting them to moq-bot, the GitHub App release-plz tags with, plus the role the `release` branch ruleset already lets bypass: @@ -185,42 +187,27 @@ All of this runs once, by a maintainer, in this order: After editing the rules, `just infra nix lifecycle` applies them. -3. **Create the two Environments.** Name `main` rather than using a - protected-branches policy, which would admit `release` too. Skip - `cache-write` if the Rust build cache bootstrap already made it. +3. **Admit the release tags to `cache-write`**, which the Rust build cache + bootstrap created: ```bash - gh api -X PUT repos/moq-dev/moq/environments/cache-write --input - <<'EOF' - {"deployment_branch_policy": {"protected_branches": false, "custom_branch_policies": true}} - EOF - gh api -X POST repos/moq-dev/moq/environments/cache-write/deployment-branch-policies \ - -f name=main -f type=branch - - gh api -X PUT repos/moq-dev/moq/environments/nix-release --input - <<'EOF' - {"deployment_branch_policy": {"protected_branches": false, "custom_branch_policies": true}} - EOF for tag in 'moq-relay-v*' 'moq-cli-v*' 'moq-boy-v*' 'moq-c-v*' 'moq-gst-v*'; do - gh api -X POST repos/moq-dev/moq/environments/nix-release/deployment-branch-policies \ + gh api -X POST repos/moq-dev/moq/environments/cache-write/deployment-branch-policies \ -f name="$tag" -f type=tag done ``` -4. **Create two R2 API tokens** in the dashboard (R2 -> Manage API tokens -> - Create Account API token), each **Object Read & Write** on one bucket only. - Wrangler cannot create R2 tokens. Store each in its Environment: +4. **Create one R2 API token** in the dashboard (R2 -> Manage API tokens -> + Create Account API token) with **Object Read & Write** on `nix-moq-dev` and + `nix-ci-moq-dev` only. Wrangler cannot create R2 tokens. ```bash - # Scoped to nix-ci-moq-dev gh secret set NIX_R2_ACCESS_KEY_ID --env cache-write --repo moq-dev/moq gh secret set NIX_R2_SECRET_ACCESS_KEY --env cache-write --repo moq-dev/moq - - # Scoped to nix-moq-dev - gh secret set NIX_R2_ACCESS_KEY_ID --env nix-release --repo moq-dev/moq - gh secret set NIX_R2_SECRET_ACCESS_KEY --env nix-release --repo moq-dev/moq ``` -5. **Generate the signing key.** This stores it as `NIX_SIGNING_KEY` in both - Environments without writing it to disk, and prints the public key: +5. **Generate the signing key.** This stores it as `NIX_SIGNING_KEY` in + `cache-write` without writing it to disk, and prints the public key: ```bash just infra nix keygen @@ -230,7 +217,8 @@ All of this runs once, by a maintainer, in this order: A job missing its secrets fails rather than skip the push. A job naming an Environment that does not exist yet creates it with no deployment policy, so -if either workflow ran before step 3, check the policy before adding secrets. +if a workflow ran before the Rust bootstrap, check the policy before adding +secrets. To rotate the key, run `keygen` again and add the new public key next to the old one in `flake.nix`. Drop the old key once nothing signed with it matters: diff --git a/infra/nix/justfile b/infra/nix/justfile index ca539813f52..4e7095d6b04 100644 --- a/infra/nix/justfile +++ b/infra/nix/justfile @@ -8,8 +8,8 @@ deploy: # Create the release and CI R2 buckets and the CI bucket's lifecycle rule. Run once. create: bun install --frozen-lockfile - bun wrangler r2 bucket create nix-moq-dev - bun wrangler r2 bucket create nix-ci-moq-dev + bun wrangler r2 bucket create nix-moq-dev --update-config=false + bun wrangler r2 bucket create nix-ci-moq-dev --update-config=false just lifecycle # Replace the CI bucket's lifecycle rules with lifecycle.json. @@ -22,9 +22,8 @@ lifecycle: push bucket +paths: #!/usr/bin/env bash set -euo pipefail - # The R2 token must be scoped to that bucket. `nix copy` skips any path the - # bucket already has. - : "${NIX_SIGNING_KEY:?not set; the job needs the cache-write or nix-release Environment}" + # `nix copy` skips any path the bucket already has. + : "${NIX_SIGNING_KEY:?not set; the job needs the cache-write Environment}" : "${AWS_ACCESS_KEY_ID:?not set}" : "${AWS_SECRET_ACCESS_KEY:?not set}" key=$(mktemp) @@ -32,13 +31,11 @@ push bucket +paths: printf '%s' "$NIX_SIGNING_KEY" >"$key" nix copy --to "s3://{{ bucket }}?endpoint=dd618f5dbd5da77b8296f1613c301f5c.r2.cloudflarestorage.com®ion=auto&compression=zstd&secret-key=$key" {{ paths }} -# Generate a signing key into both Environments and print its public half for flake.nix. +# Generate a signing key into the cache-write Environment and print its public half for flake.nix. keygen: #!/usr/bin/env bash set -euo pipefail key=$(nix key generate-secret --key-name nix.moq.dev-1) - for env in cache-write nix-release; do - printf '%s' "$key" | gh secret set NIX_SIGNING_KEY --env "$env" --repo moq-dev/moq - done + printf '%s' "$key" | gh secret set NIX_SIGNING_KEY --env cache-write --repo moq-dev/moq printf '%s' "$key" | nix key convert-secret-to-public echo diff --git a/quest/m0/ci/nix-cache-verify.md b/quest/m0/ci/nix-cache-verify.md index 6a175a5dcdf..88e1baf6c3d 100644 --- a/quest/m0/ci/nix-cache-verify.md +++ b/quest/m0/ci/nix-cache-verify.md @@ -4,7 +4,7 @@ Condition: a maintainer has run the `nix.moq.dev` bootstrap in `infra/README.md` (the release tag ruleset, both buckets and the Worker, the -`cache-write` and `nix-release` Environments and their secrets, and the +`cache-write` Environment's tag policies and secrets, and the signing key), and the PR that wired it in has merged with the real public key in `flake.nix`. Check it with `curl https://nix.moq.dev/nix-cache-info` and `gh run list --workflow cache.yml --branch main`. From 5c2096b754ac5453dceffe9a25b5cb40bcc24aa9 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 20 Oct 2026 08:58:31 -0700 Subject: [PATCH 4/4] quest(ci): watch for the post-expiry cold window on nix.moq.dev Co-Authored-By: Claude Opus 5.5 --- quest/m0/ci/nix-cache-verify.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/quest/m0/ci/nix-cache-verify.md b/quest/m0/ci/nix-cache-verify.md index 85a3350878b..60aae1f4f35 100644 --- a/quest/m0/ci/nix-cache-verify.md +++ b/quest/m0/ci/nix-cache-verify.md @@ -20,8 +20,12 @@ Then confirm it, and record the numbers in the PR that closes this: `release-nix.yml` legs, and `nix run github:moq-dev/moq/#moq-relay --accept-flake-config` substitutes on a clean machine. - Dev shell upload time and both bucket sizes after a month, against the - 30-day expiry in `infra/nix/lifecycle.json`. Switch to a closure-aware - collector (niks3) only if expiry makes CI fall back to source builds often. + 30-day expiry in `infra/nix/lifecycle.json`. A path expires 30 days after + its upload even while CI still reads it, and only the next warm restores + it, which runs on a flake or `nix/**` change or a dispatch. Look for jobs + that fell back to source builds in that window. If they recur, add a daily + schedule to `cache.yml` (and alert on its scheduled failures) or switch to + a closure-aware collector (niks3). - Delete the `CACHIX_AUTH_TOKEN` secret and the `kixelated` Cachix cache once the maintainer decides downstream flakes have had long enough to switch.