Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chore(ci): remove cachix (#5370)

teod89815450183
diff --git a/.github/actions/deploy-cloud-storage-pulumi/action.yml b/.github/actions/deploy-cloud-storage-pulumi/action.yml
index a654eb233e..421ca5e044 100644
--- a/.github/actions/deploy-cloud-storage-pulumi/action.yml
+++ b/.github/actions/deploy-cloud-storage-pulumi/action.yml
@@ -68,14 +68,6 @@ inputs:
description: 'Optional service key from .github/services-config.json; builds Lambda artifacts inline when lambda-artifacts is not provided'
required: false
default: ''
- cachix-auth-token:
- description: 'Cachix auth token used for inline Lambda artifact builds'
- required: false
- default: ''
- sccache-bucket:
- description: 'Optional S3 bucket for shared sccache storage during inline Lambda artifact builds'
- required: false
- default: ''
runs:
using: composite
@@ -144,13 +136,6 @@ runs:
has_lambdas=$(jq -r --arg service "$SERVICE" '((.services[$service].deploy_lambdas // []) | length) > 0' .github/services-config.json)
echo "has_lambdas=$has_lambdas" >> "$GITHUB_OUTPUT"
- - name: Configure Cachix
- if: ${{ inputs.lambda-artifacts == '' && inputs.lambda-artifacts-tar == '' && inputs.cloud-storage-service-name != '' && steps.check-lambdas.outputs.has_lambdas == 'true' }}
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ inputs.cachix-auth-token }}
- sccache-bucket: ${{ inputs.sccache-bucket }}
-
- name: Build Lambda artifacts inline
if: ${{ inputs.lambda-artifacts == '' && inputs.lambda-artifacts-tar == '' && inputs.cloud-storage-service-name != '' && steps.check-lambdas.outputs.has_lambdas == 'true' }}
shell: bash
diff --git a/.github/actions/preview-cloud-storage-pulumi/action.yml b/.github/actions/preview-cloud-storage-pulumi/action.yml
index 3d5912ee53..fcce36eb16 100644
--- a/.github/actions/preview-cloud-storage-pulumi/action.yml
+++ b/.github/actions/preview-cloud-storage-pulumi/action.yml
@@ -48,14 +48,6 @@ inputs:
description: 'Optional service key from .github/services-config.json; used to build Lambda artifacts before preview'
required: false
default: ''
- cachix-auth-token:
- description: 'Cachix auth token used when building Lambda artifacts'
- required: false
- default: ''
- sccache-bucket:
- description: 'Optional S3 bucket for shared sccache storage during Lambda artifact builds'
- required: false
- default: ''
runs:
using: composite
@@ -65,13 +57,6 @@ runs:
with:
lfs: ${{ inputs.use-lfs }}
- - name: Configure Cachix
- if: ${{ inputs.cloud-storage-service-name != '' }}
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ inputs.cachix-auth-token }}
- sccache-bucket: ${{ inputs.sccache-bucket }}
-
- name: Check Lambda config
if: ${{ inputs.cloud-storage-service-name != '' }}
id: check-lambdas
diff --git a/.github/actions/setup-cachix/action.yml b/.github/actions/setup-cachix/action.yml
deleted file mode 100644
index bd1f1239aa..0000000000
--- a/.github/actions/setup-cachix/action.yml
+++ /dev/null
@@ -1,130 +0,0 @@
-name: Setup Cachix
-description: Install Cachix if needed and configure the macro-inc binary cache.
-
-inputs:
- cachix-auth-token:
- description: Cachix auth token used to configure authenticated pulls and pushes.
- required: false
- default: ''
- cache-name:
- description: Cachix cache name.
- required: false
- default: macro-inc
- dev-shell:
- description: Enter the repository Nix dev shell after configuring Cachix.
- required: false
- default: 'false'
- sccache-bucket:
- description: Optional S3 bucket for shared sccache storage.
- required: false
- default: ''
- sccache-region:
- description: AWS region for the shared sccache S3 bucket.
- required: false
- default: us-east-1
- sccache-s3-key-prefix:
- description: S3 key prefix for shared sccache storage.
- required: false
- default: sccache/
-
-runs:
- using: composite
- steps:
- - name: Configure Cachix
- shell: bash
- env:
- CACHIX_AUTH_TOKEN: ${{ inputs.cachix-auth-token }}
- CACHIX_CACHE_NAME: ${{ inputs.cache-name }}
- run: |
- set -euo pipefail
- export NIX_REMOTE=daemon
- export PATH="$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH"
- echo "$HOME/.nix-profile/bin" >> "$GITHUB_PATH"
- echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"
- echo "CACHIX_CACHE_NAME=$CACHIX_CACHE_NAME" >> "$GITHUB_ENV"
-
- # A binary cache can return a valid narinfo while its backing NAR is
- # temporarily unavailable. Without fallback, Nix fails the build after
- # exhausting download retries instead of building that path locally.
- # Preserve any runner-provided NIX_CONFIG.
- {
- echo 'NIX_CONFIG<<__MACRO_NIX_CONFIG__'
- if [ -n "${NIX_CONFIG:-}" ]; then
- printf '%s\n' "$NIX_CONFIG"
- fi
- echo 'fallback = true'
- echo '__MACRO_NIX_CONFIG__'
- } >> "$GITHUB_ENV"
-
- retry() {
- local attempts=$1
- shift
- local delay=5
- local attempt=1
-
- until "$@"; do
- if [ "$attempt" -ge "$attempts" ]; then
- return 1
- fi
- echo "Command failed, retrying in ${delay}s (${attempt}/${attempts}): $*" >&2
- sleep "$delay"
- attempt=$((attempt + 1))
- delay=$((delay * 2))
- done
- }
-
- if ! command -v cachix >/dev/null 2>&1; then
- # Install cachix from the repo flake's pinned nixpkgs (already on the
- # /nix sticky disk) via --inputs-from, instead of the default registry
- # `nixpkgs`, which Determinate resolves to an unpinned nixpkgs-weekly
- # and re-fetches/re-evaluates (~20s) on every run.
- flake_dir="${GITHUB_WORKSPACE:-$PWD}"
- if ! retry 3 nix profile add --inputs-from "$flake_dir" nixpkgs#cachix; then
- echo "::warning::Failed to install Cachix from the pinned flake; falling back to registry nixpkgs."
- if ! retry 3 nix profile add nixpkgs#cachix; then
- echo "::warning::Failed to install Cachix; continuing without the Cachix binary cache."
- fi
- fi
- fi
-
- export PATH="$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH"
- if command -v cachix >/dev/null 2>&1; then
- if [ -n "$CACHIX_AUTH_TOKEN" ] && ! retry 3 cachix authtoken "$CACHIX_AUTH_TOKEN"; then
- echo "::warning::Failed to authenticate Cachix; continuing without authenticated cache access."
- fi
- if ! retry 3 cachix use "$CACHIX_CACHE_NAME"; then
- echo "::warning::Failed to configure Cachix cache '$CACHIX_CACHE_NAME'; continuing without the Cachix binary cache."
- fi
- else
- echo "::warning::Cachix is unavailable; continuing without the Cachix binary cache."
- fi
-
- - name: Configure sccache
- shell: bash
- env:
- SCCACHE_BUCKET_INPUT: ${{ inputs.sccache-bucket }}
- SCCACHE_REGION_INPUT: ${{ inputs.sccache-region }}
- SCCACHE_S3_KEY_PREFIX_INPUT: ${{ inputs.sccache-s3-key-prefix }}
- run: |
- set -euo pipefail
- mkdir -p "$HOME/.cache/sccache"
- {
- echo "SCCACHE_DIR=$HOME/.cache/sccache"
- echo "SCCACHE_CACHE_SIZE=5G"
- echo "SCCACHE_BASEDIR=${GITHUB_WORKSPACE:-$PWD}"
- if [ -n "$SCCACHE_BUCKET_INPUT" ]; then
- echo "SCCACHE_BUCKET=$SCCACHE_BUCKET_INPUT"
- echo "SCCACHE_REGION=$SCCACHE_REGION_INPUT"
- echo "SCCACHE_S3_KEY_PREFIX=$SCCACHE_S3_KEY_PREFIX_INPUT"
- fi
- } >> "$GITHUB_ENV"
-
- - name: Enter Nix dev shell
- if: ${{ inputs.dev-shell == 'true' }}
- shell: bash
- run: |
- set -euo pipefail
- nix print-dev-env --accept-flake-config > /tmp/dev-env
- echo "BASH_ENV=/tmp/dev-env" >> "$GITHUB_ENV"
- source /tmp/dev-env
- printf '%s\n' "$PATH" | tr ':' '\n' >> "$GITHUB_PATH"
diff --git a/.github/actions/setup-nix/action.yml b/.github/actions/setup-nix/action.yml
index d3d490b25e..6bf93e1178 100644
--- a/.github/actions/setup-nix/action.yml
+++ b/.github/actions/setup-nix/action.yml
@@ -7,24 +7,11 @@ description: >-
systemd is active (full VMs), otherwise starts nix-daemon directly as a
background process (e.g. Namespace runners, where systemd is not active).
-inputs:
- extra-substituters:
- description: Space-separated extra binary cache substituters to trust.
- required: false
- default: ''
- extra-trusted-public-keys:
- description: Space-separated public keys for the extra substituters.
- required: false
- default: ''
-
runs:
using: composite
steps:
- name: Install or re-initialise Nix
shell: bash
- env:
- EXTRA_SUBSTITUTERS: ${{ inputs.extra-substituters }}
- EXTRA_TRUSTED_PUBLIC_KEYS: ${{ inputs.extra-trusted-public-keys }}
run: |
set -euo pipefail
@@ -109,20 +96,4 @@ runs:
export NIX_REMOTE=daemon
echo "NIX_REMOTE=daemon" >> "$GITHUB_ENV"
- # Append fallback substituters (e.g. Cachix) so a cold cache volume
- # pulls prebuilt artifacts instead of compiling from source.
- if [[ -n "${EXTRA_SUBSTITUTERS}" ]]; then
- {
- echo "extra-substituters = ${EXTRA_SUBSTITUTERS}"
- echo "extra-trusted-public-keys = ${EXTRA_TRUSTED_PUBLIC_KEYS}"
- } | sudo tee -a /etc/nix/nix.conf >/dev/null
- if $have_systemd; then
- sudo systemctl restart nix-daemon.service 2>/dev/null || true
- else
- sudo pkill -x nix-daemon 2>/dev/null || true
- sleep 1
- start_daemon
- fi
- fi
-
"$nix_bin" --version || nix --version
diff --git a/.github/actions/setup-sccache/action.yml b/.github/actions/setup-sccache/action.yml
index dc531a2a64..6e5f83562a 100644
--- a/.github/actions/setup-sccache/action.yml
+++ b/.github/actions/setup-sccache/action.yml
@@ -7,10 +7,6 @@ inputs:
description: sccache release version to install
required: false
default: v0.15.0
- cache-key-prefix:
- description: Prefix for the local GitHub Actions cache key
- required: false
- default: sccache
runs:
using: composite
@@ -108,18 +104,4 @@ runs:
echo "SCCACHE_BASEDIR=${GITHUB_WORKSPACE:-$PWD}"
} >> "$GITHUB_ENV"
- # Configure an S3 backend when SCCACHE_BUCKET is provided. AWS credentials
- # are intentionally not persisted here; scope them to the cargo steps that
- # actually compile code so third-party setup actions don't receive them.
- if [[ -n "${SCCACHE_BUCKET:-}" ]]; then
- {
- echo "SCCACHE_BUCKET=${SCCACHE_BUCKET}"
- echo "SCCACHE_REGION=${SCCACHE_REGION:-us-east-1}"
- echo "SCCACHE_S3_KEY_PREFIX=${SCCACHE_S3_KEY_PREFIX:-sccache/}"
- } >> "$GITHUB_ENV"
- echo "Configured sccache for S3 bucket ${SCCACHE_BUCKET}"
- else
- echo "No remote sccache bucket configured; using local cached sccache directory."
- fi
-
"$sccache_bin" --version
diff --git a/.github/scripts/build-cloud-storage-lambdas-nix.sh b/.github/scripts/build-cloud-storage-lambdas-nix.sh
index 95580589e0..4872e7e7e1 100755
--- a/.github/scripts/build-cloud-storage-lambdas-nix.sh
+++ b/.github/scripts/build-cloud-storage-lambdas-nix.sh
@@ -7,8 +7,8 @@ set -euo pipefail
# cargo-lambda script produced, so nothing downstream changes.
#
# Unlike the cargo-lambda path, this never recompiles unchanged handlers: nix is
-# content-addressed, so an unchanged handler is a pure cache hit (substituted
-# from the warm /nix lambda disk or Cachix). Independent handler derivations
+# content-addressed, so an unchanged handler is a pure cache hit from the
+# Namespace Nix volume. Independent handler derivations
# also build in parallel within the single `nix build` invocation.
SERVICE="${SERVICE:?SERVICE is required}"
@@ -29,13 +29,6 @@ fi
echo "Building Lambda artifacts for $SERVICE via nix: ${LAMBDAS[*]}"
-cachix_pid=
-if command -v cachix >/dev/null 2>&1 && [[ -n "${CACHIX_CACHE_NAME:-}" ]]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [[ -n "${cachix_pid:-}" ]]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
-fi
-
# Build every handler for this service in one nix invocation: independent
# derivations build in parallel, unchanged ones are pure cache hits, and the
# out paths are captured here (stdout) while build logs stream to stderr —
diff --git a/.github/workflows/build-rust-ci-image.yml b/.github/workflows/build-rust-ci-image.yml
index c63da141f3..689f3d217c 100644
--- a/.github/workflows/build-rust-ci-image.yml
+++ b/.github/workflows/build-rust-ci-image.yml
@@ -40,12 +40,6 @@ jobs:
echo 'PATH="/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"' \
| sudo tee /etc/environment >/dev/null
- - name: Configure Cachix
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
-
- name: Materialize dev shell into /nix/store
shell: bash
run: |
@@ -54,13 +48,6 @@ jobs:
export PATH="/nix/var/nix/profiles/default/bin:$PATH"
sudo mkdir -p /var/cache/nix
sudo chown runner:runner /var/cache/nix
- if command -v cachix >/dev/null 2>&1; then
- cachix watch-store "$CACHIX_CACHE_NAME" &
- cachix_pid=$!
- trap 'kill "$cachix_pid" || true' EXIT
- else
- echo "::warning::Cachix is unavailable; skipping Cachix store uploads."
- fi
nix develop --profile /var/cache/nix/dev-shell --command true
- name: Write image markers
@@ -85,13 +72,6 @@ jobs:
set -euo pipefail
export NIX_REMOTE=daemon
export PATH="/nix/var/nix/profiles/default/bin:$PATH"
- if command -v cachix >/dev/null 2>&1; then
- cachix watch-store "$CACHIX_CACHE_NAME" &
- cachix_pid=$!
- trap 'kill "$cachix_pid" || true' EXIT
- else
- echo "::warning::Cachix is unavailable; skipping Cachix store uploads."
- fi
nix --version
test -L /var/cache/nix/dev-shell
nix develop --profile /var/cache/nix/dev-shell --command bash -lc '
diff --git a/.github/workflows/build_appimage_on_tag.yml b/.github/workflows/build_appimage_on_tag.yml
index e8782e2bce..0825fbfe14 100644
--- a/.github/workflows/build_appimage_on_tag.yml
+++ b/.github/workflows/build_appimage_on_tag.yml
@@ -25,10 +25,6 @@ jobs:
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- - name: Configure Cachix fallback
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- id: metadata
name: Derive artifact metadata
run: |
@@ -46,12 +42,6 @@ jobs:
- name: Build AppImage with Nix
run: |
set -euo pipefail
- cachix_pid=
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${cachix_pid:-}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
- fi
restart_nix_daemon() {
echo "::warning::Restarting nix-daemon before retrying AppImage build."
sudo systemctl restart nix-daemon.service 2>/dev/null || true
@@ -101,9 +91,6 @@ jobs:
restart_nix_daemon
sleep $((attempt * 10))
done
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix push "$CACHIX_CACHE_NAME" result || echo "::warning::Failed to push AppImage result closure to Cachix."
- fi
shell: bash
- name: Collect AppImage artifact
run: |
diff --git a/.github/workflows/build_desktop_on_tag.yml b/.github/workflows/build_desktop_on_tag.yml
index 6dc52fa238..15ee947ed5 100644
--- a/.github/workflows/build_desktop_on_tag.yml
+++ b/.github/workflows/build_desktop_on_tag.yml
@@ -88,10 +88,6 @@ jobs:
continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- - name: Configure Cachix fallback
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- id: metadata
name: Derive artifact metadata
run: |
@@ -109,12 +105,6 @@ jobs:
- name: Build AppImage with Nix
run: |
set -euo pipefail
- cachix_pid=
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${cachix_pid:-}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
- fi
restart_nix_daemon() {
echo "::warning::Restarting nix-daemon before retrying AppImage build."
sudo systemctl restart nix-daemon.service 2>/dev/null || true
@@ -164,9 +154,6 @@ jobs:
restart_nix_daemon
sleep $((attempt * 10))
done
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix push "$CACHIX_CACHE_NAME" result || echo "::warning::Failed to push AppImage result closure to Cachix."
- fi
shell: bash
- name: Collect AppImage artifact
run: |
@@ -229,10 +216,6 @@ jobs:
export NIX_REMOTE=daemon
nix --version
shell: bash
- - name: Configure Cachix fallback
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Configure signing identity
run: |
set -euo pipefail
@@ -292,16 +275,7 @@ jobs:
- name: Build DMG with Nix
run: |
set -euo pipefail
- cachix_pid=
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${cachix_pid:-}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
- fi
nix build --impure --option sandbox false --print-build-logs ".#packages.aarch64-darwin.tauri-desktop-dmg"
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix push "$CACHIX_CACHE_NAME" result || echo "::warning::Failed to push DMG result closure to Cachix."
- fi
shell: bash
- name: Collect DMG artifact
run: |
diff --git a/.github/workflows/build_dmg_on_tag.yml b/.github/workflows/build_dmg_on_tag.yml
index a763082cc5..fa605875f4 100644
--- a/.github/workflows/build_dmg_on_tag.yml
+++ b/.github/workflows/build_dmg_on_tag.yml
@@ -43,10 +43,6 @@ jobs:
export NIX_REMOTE=daemon
nix --version
shell: bash
- - name: Configure Cachix fallback
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Configure signing identity
run: |
set -euo pipefail
@@ -106,16 +102,7 @@ jobs:
- name: Build DMG with Nix
run: |
set -euo pipefail
- cachix_pid=
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${cachix_pid:-}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
- fi
nix build --impure --option sandbox false --print-build-logs ".#packages.aarch64-darwin.tauri-desktop-dmg"
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix push "$CACHIX_CACHE_NAME" result || echo "::warning::Failed to push DMG result closure to Cachix."
- fi
shell: bash
- name: Collect DMG artifact
run: |
diff --git a/.github/workflows/cargo_workspace_dependency_check.yml b/.github/workflows/cargo_workspace_dependency_check.yml
index 5cde297521..6922d0603e 100644
--- a/.github/workflows/cargo_workspace_dependency_check.yml
+++ b/.github/workflows/cargo_workspace_dependency_check.yml
@@ -36,10 +36,7 @@ jobs:
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Nix dev shell
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- dev-shell: 'true'
+ uses: './.github/actions/setup-nix-dev-shell'
- name: Configure Namespace remote sccache
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.event.pull_request.head.repo.full_name == github.repository
run: |-
@@ -78,6 +75,9 @@ jobs:
# human-written crates for duplicate dependencies.
sed -i '/^ "crates\/workspace-hack",$/d' Cargo.toml
cargo-workspace-dependency-checker
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
hakari-and-dep-closures:
runs-on: namespace-profile-linux-rust-ci;overrides.cache-tag=sccache-ci
steps:
@@ -92,10 +92,7 @@ jobs:
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Nix dev shell
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- dev-shell: 'true'
+ uses: './.github/actions/setup-nix-dev-shell'
- name: Configure Namespace remote sccache
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.event.pull_request.head.repo.full_name == github.repository
run: |-
@@ -127,6 +124,9 @@ jobs:
- name: generated dependency artifacts are up to date
run: |
cargo run -p xtask --locked -- deps --check
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
concurrency:
group: cargo-workspace-dependency-check-${{ github.ref }}
cancel-in-progress: true
diff --git a/.github/workflows/check_node_modules_nix.yml b/.github/workflows/check_node_modules_nix.yml
index b05acf3215..539df18edc 100644
--- a/.github/workflows/check_node_modules_nix.yml
+++ b/.github/workflows/check_node_modules_nix.yml
@@ -31,14 +31,18 @@ jobs:
with:
clean: 'false'
persist-credentials: 'false'
+ - name: Mount /nix cache volume
+ uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0
+ with:
+ cache: nix
+ continue-on-error: true
- name: Setup Nix
uses: './.github/actions/setup-nix'
- - name: Configure Cachix fallback
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: verify js node_modules derivation is up to date
run: nix build .#js-node-modules --no-link
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
check-darwin-node-modules-nix:
name: check Darwin node_modules nix
runs-on: macos-15
@@ -73,9 +77,5 @@ jobs:
export NIX_REMOTE=daemon
nix --version
shell: bash
- - name: Configure Cachix fallback
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: verify js node_modules derivation is up to date
run: nix build .#js-node-modules --no-link
diff --git a/.github/workflows/code_check_cloud_storage.yml b/.github/workflows/code_check_cloud_storage.yml
index 4ce33d493a..c291434b70 100644
--- a/.github/workflows/code_check_cloud_storage.yml
+++ b/.github/workflows/code_check_cloud_storage.yml
@@ -57,7 +57,9 @@ jobs:
- 'static_assets/**'
- 'flake.nix'
- 'flake.lock'
- - '.github/actions/setup-cachix/**'
+ - '.github/actions/setup-nix/**'
+ - '.github/actions/setup-nix-dev-shell/**'
+ - '.github/actions/teardown-nix/**'
- '.github/actions/setup-sccache/**'
- '.github/services-config.json'
- '.github/scripts/build-cloud-storage-lambdas.sh'
@@ -107,7 +109,7 @@ jobs:
# live Postgres (SQLX_OFFLINE is unset there), so `.sqlx` contents cannot change
# test outcomes, and a query change always comes with a source change in the
# owning crate, which the package filter below already maps.
- if grep -qE '^(Cargo\.(toml|lock)|rust-toolchain\.toml|Cross\.toml|clippy\.toml|deny\.toml|\.cargo/.*|\.config/.*|flake\.nix|flake\.lock|\.github/actions/(setup-rust|setup-cachix|setup-sccache)/.*|\.github/workflows/code_check_cloud_storage\.yml)$' /tmp/changed-files; then
+ if grep -qE '^(Cargo\.(toml|lock)|rust-toolchain\.toml|Cross\.toml|clippy\.toml|deny\.toml|\.cargo/.*|\.config/.*|flake\.nix|flake\.lock|\.github/actions/(setup-rust|setup-nix|setup-nix-dev-shell|setup-sccache)/.*|\.github/workflows/code_check_cloud_storage\.yml)$' /tmp/changed-files; then
echo "Workspace-level change detected; running all tests"
echo "nextest_filter=" >> "$GITHUB_OUTPUT"
exit 0
@@ -156,10 +158,7 @@ jobs:
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Nix dev shell
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- dev-shell: 'true'
+ uses: './.github/actions/setup-nix-dev-shell'
- name: Configure Namespace remote sccache
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.event.pull_request.head.repo.full_name == github.repository
run: |-
@@ -244,6 +243,9 @@ jobs:
- name: show sccache stats
if: always()
run: sccache --show-stats || true
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
test:
needs:
- path-check
@@ -283,10 +285,7 @@ jobs:
- name: Setup Nix
uses: './.github/actions/setup-nix'
- name: Setup Nix dev shell
- uses: './.github/actions/setup-cachix'
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- dev-shell: 'true'
+ uses: './.github/actions/setup-nix-dev-shell'
- name: Configure Namespace remote sccache
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.event.pull_request.head.repo.full_name == github.repository
run: |-
@@ -353,6 +352,9 @@ jobs:
- name: show sccache stats
if: always()
run: sccache --show-stats || true
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
status-check:
needs:
- path-check
diff --git a/.github/workflows/code_check_conventions.yml b/.github/workflows/code_check_conventions.yml
index da4977af7d..e86007b67a 100644
--- a/.github/workflows/code_check_conventions.yml
+++ b/.github/workflows/code_check_conventions.yml
@@ -36,6 +36,7 @@ jobs:
- 'packages/**'
- 'rules/**'
- 'sgconfig.yml'
+ - '.github/actions/teardown-nix/**'
- '.github/workflows/code_check_conventions.yml'
ast-grep:
needs:
@@ -61,6 +62,9 @@ jobs:
uses: './.github/actions/setup-nix-dev-shell'
- name: Run ast-grep
run: bunx --yes @ast-grep/[email protected] scan
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
status-check:
needs:
- path-check
diff --git a/.github/workflows/code_check_infra.yml b/.github/workflows/code_check_infra.yml
index e0645d3988..653ffda64c 100644
--- a/.github/workflows/code_check_infra.yml
+++ b/.github/workflows/code_check_infra.yml
@@ -28,6 +28,7 @@ jobs:
- 'flake.nix'
- 'flake.lock'
- '.github/actions/setup-nix-dev-shell/**'
+ - '.github/actions/teardown-nix/**'
- '.github/workflows/code_check_infra.yml'
biome-check:
needs:
@@ -52,6 +53,9 @@ jobs:
- name: Run Biome
run: biome ci --changed --no-errors-on-unmatched --error-on-warnings
working-directory: infra
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
check:
needs:
- path-check
@@ -76,6 +80,9 @@ jobs:
- name: check
run: bun run check
working-directory: infra
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
status-check:
needs:
- path-check
diff --git a/.github/workflows/deploy-pulumi-stack.yml b/.github/workflows/deploy-pulumi-stack.yml
index 1c608240b3..266709b899 100644
--- a/.github/workflows/deploy-pulumi-stack.yml
+++ b/.github/workflows/deploy-pulumi-stack.yml
@@ -25,19 +25,19 @@ concurrency:
jobs:
deploy:
- runs-on:
- [
- runs-on,
- runner=8cpu-linux-x64,
- hdd=40,
- spot=false,
- ssh=false,
- 'run-id=${{github.run_id}}',
- ]
+ runs-on: namespace-profile-linux-mid
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
ref: ${{ github.ref_name }}
+ persist-credentials: false
+ - name: Mount Namespace Nix cache
+ continue-on-error: true
+ uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0 # v1.4.3
+ with:
+ cache: nix
+ - name: Setup Nix
+ uses: ./.github/actions/setup-nix
- uses: ./.github/actions/deploy-cloud-storage-pulumi
with:
environment: ${{ inputs.environment }}
@@ -46,7 +46,8 @@ jobs:
pulumi-access-token: ${{ secrets.PULUMI_ACCESS_TOKEN }}
pulumi-service-name: ${{ inputs.pulumi-service-name }} # TODO: we should have validation that this is a valid pulumi service name before we allow it to be set here
cloud-storage-service-name: ${{ inputs.cloud-storage-service-name }}
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- sccache-bucket: ${{ vars.SCCACHE_BUCKET || secrets.SCCACHE_BUCKET }}
dd-app-key: ${{ secrets.DD_APP_KEY }}
dd-api-key: ${{ secrets.DD_API_KEY }}
+ - name: Teardown Nix
+ if: ${{ always() }}
+ uses: ./.github/actions/teardown-nix
diff --git a/.github/workflows/deploy_all_services.yml b/.github/workflows/deploy_all_services.yml
index 544776cd06..9087789e3b 100644
--- a/.github/workflows/deploy_all_services.yml
+++ b/.github/workflows/deploy_all_services.yml
@@ -19,8 +19,6 @@ on:
required: true
DD_API_KEY:
required: true
- CACHIX_AUTH_TOKEN:
- required: true
workflow_dispatch:
inputs:
environment:
@@ -79,19 +77,9 @@ jobs:
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
- - name: Configure Cachix fallback
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Warm shared release deps
- run: |
+ run: |-
set -euo pipefail
- cachix_pid=
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${cachix_pid:-}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
- fi
nix build --print-build-logs ".#deployCargoArtifacts"
echo "Shared release deps realised into /nix/store; committed on job exit."
shell: bash
@@ -116,19 +104,9 @@ jobs:
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
- - name: Configure Cachix fallback
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Warm shared lambda dep closure
- run: |
+ run: |-
set -euo pipefail
- cachix_pid=
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${cachix_pid:-}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
- fi
nix build --print-build-logs ".#lambdaDeployCargoArtifacts" ".#callRecordingPreviewFfmpegLayer"
echo "Shared lambda deps realised into /nix/store; committed on job exit."
shell: bash
@@ -159,19 +137,9 @@ jobs:
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
- - name: Configure Cachix fallback
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build prebuilt binaries
- run: |+
+ run: |
set -euo pipefail
- cachix_pid=
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${cachix_pid:-}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
- fi
mkdir -p prebuilt
nix build --print-build-logs ".#deploy-service-binaries-${SERVICE}"
cp -r result/bin/* prebuilt/
@@ -183,7 +151,6 @@ jobs:
tar -C prebuilt -czf prebuilt-binaries.tar.gz .
# Receipt: the deploy job logs the same hash on read.
echo "handoff receipt: $(sha256sum prebuilt-binaries.tar.gz | cut -d' ' -f1) ($(stat -c%s prebuilt-binaries.tar.gz) bytes)"
-
shell: bash
env:
SERVICE: ${{ matrix.service }}
@@ -219,10 +186,6 @@ jobs:
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
- - name: Configure Cachix fallback
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build Lambda artifacts
run: .github/scripts/build-cloud-storage-lambdas-nix.sh
env:
diff --git a/.github/workflows/deploy_cloud_storage_on_push.yml b/.github/workflows/deploy_cloud_storage_on_push.yml
index 001b943852..4d3cb6e085 100644
--- a/.github/workflows/deploy_cloud_storage_on_push.yml
+++ b/.github/workflows/deploy_cloud_storage_on_push.yml
@@ -30,7 +30,6 @@ on:
- .github/actions/deploy-cloud-storage-pulumi/**
- .github/actions/setup-nix/**
- .github/actions/teardown-nix/**
- - .github/actions/setup-cachix/**
- .github/actions/migrate-cloud-storage-db/**
- .github/scripts/build-cloud-storage-lambdas-nix.sh
- .github/services-config.json
@@ -49,4 +48,3 @@ jobs:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
DD_APP_KEY: ${{ secrets.DD_APP_KEY }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
- CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
diff --git a/.github/workflows/deploy_preview.yml b/.github/workflows/deploy_preview.yml
index 636e2271b6..bb4975a2a6 100644
--- a/.github/workflows/deploy_preview.yml
+++ b/.github/workflows/deploy_preview.yml
@@ -83,6 +83,9 @@ jobs:
--preview-id ${{ steps.preview-id.outputs.id }} \
--sha ${{ github.sha }}
working-directory: apps/web
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
concurrency:
group: preview-${{ github.event.pull_request.number }}
cancel-in-progress: true
diff --git a/.github/workflows/deploy_web_app.yml b/.github/workflows/deploy_web_app.yml
index ff1def3c63..19c99d5710 100644
--- a/.github/workflows/deploy_web_app.yml
+++ b/.github/workflows/deploy_web_app.yml
@@ -101,6 +101,9 @@ jobs:
name: web-app-build
path: apps/web/dist
overwrite: 'true'
+ - name: Teardown Nix
+ if: always()
+ uses: ./.github/actions/teardown-nix
concurrency:
group: deploy-web-app-${{ inputs.environment }}
cancel-in-progress: false
diff --git a/.github/workflows/preview-fly.yml b/.github/workflows/preview-fly.yml
index 9b094642fd..f7fc03d9bb 100644
--- a/.github/workflows/preview-fly.yml
+++ b/.github/workflows/preview-fly.yml
@@ -743,6 +743,9 @@ jobs:
body,
});
}
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
concurrency:
group: fly-preview-${{ github.event.pull_request.number }}
cancel-in-progress: true
diff --git a/.github/workflows/pulumi_preview_pr.yml b/.github/workflows/pulumi_preview_pr.yml
index 147573c359..31eb3a8aa6 100644
--- a/.github/workflows/pulumi_preview_pr.yml
+++ b/.github/workflows/pulumi_preview_pr.yml
@@ -28,7 +28,8 @@ on:
- .github/workflows/pulumi_preview_pr.yml
- .github/workflows/reusable_preview_service.yml
- .github/actions/preview-cloud-storage-pulumi/**
- - .github/actions/setup-cachix/**
+ - .github/actions/setup-nix/**
+ - .github/actions/teardown-nix/**
- .github/scripts/build-cloud-storage-lambdas-nix.sh
- .github/services-config.json
permissions:
@@ -72,7 +73,8 @@ jobs:
.github/workflows/pulumi_preview_pr.yml
.github/workflows/reusable_preview_service.yml
.github/actions/preview-cloud-storage-pulumi/**
- .github/actions/setup-cachix/**
+ .github/actions/setup-nix/**
+ .github/actions/teardown-nix/**
.github/scripts/build-cloud-storage-lambdas-nix.sh
.github/services-config.json
write_output_files: 'true'
@@ -111,7 +113,8 @@ jobs:
"$file" == ".github/workflows/pulumi_preview_pr.yml" || \
"$file" == ".github/workflows/reusable_preview_service.yml" || \
"$file" == .github/actions/preview-cloud-storage-pulumi/* || \
- "$file" == .github/actions/setup-cachix/* || \
+ "$file" == .github/actions/setup-nix/* || \
+ "$file" == .github/actions/teardown-nix/* || \
"$file" == ".github/scripts/build-cloud-storage-lambdas-nix.sh" ]]; then
service_changed=true
break
diff --git a/.github/workflows/release-production.yml b/.github/workflows/release-production.yml
index e75c70263e..f0cb1e4d6b 100644
--- a/.github/workflows/release-production.yml
+++ b/.github/workflows/release-production.yml
@@ -22,7 +22,6 @@ jobs:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
DD_APP_KEY: ${{ secrets.DD_APP_KEY }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
- CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
deploy-sync-service:
name: Deploy Sync Service
@@ -69,6 +68,9 @@ jobs:
name: web-app-prod-build
path: apps/web/dist
retention-days: 7
+ - name: Teardown Nix
+ if: ${{ always() }}
+ uses: ./.github/actions/teardown-nix
deploy:
name: Deploy Web App
@@ -123,6 +125,9 @@ jobs:
DATADOG_API_KEY: ${{ secrets.DD_API_KEY }}
DATADOG_SITE: us5.datadoghq.com
DATADOG_API_HOST: api.us5.datadoghq.com
+ - name: Teardown Nix
+ if: ${{ always() }}
+ uses: ./.github/actions/teardown-nix
upload:
name: Upload Release Artifacts
diff --git a/.github/workflows/reusable_deploy_service.yml b/.github/workflows/reusable_deploy_service.yml
index c10cca9ad6..2807f40582 100644
--- a/.github/workflows/reusable_deploy_service.yml
+++ b/.github/workflows/reusable_deploy_service.yml
@@ -37,8 +37,6 @@ on:
required: true
DD_API_KEY:
required: true
- CACHIX_AUTH_TOKEN:
- required: true
jobs:
setup:
name: Check ${{ inputs.service-name }} artifacts
@@ -83,19 +81,9 @@ jobs:
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
- - name: Configure Cachix fallback
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build prebuilt binaries
- run: |+
+ run: |
set -euo pipefail
- cachix_pid=
- if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${cachix_pid:-}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
- fi
mkdir -p prebuilt
nix build --print-build-logs ".#deploy-service-binaries-${SERVICE}"
cp -r result/bin/* prebuilt/
@@ -107,7 +95,6 @@ jobs:
tar -C prebuilt -czf prebuilt-binaries.tar.gz .
# Receipt: the deploy job logs the same hash on read.
echo "handoff receipt: $(sha256sum prebuilt-binaries.tar.gz | cut -d' ' -f1) ($(stat -c%s prebuilt-binaries.tar.gz) bytes)"
-
shell: bash
env:
SERVICE: ${{ inputs.service-name }}
@@ -138,10 +125,6 @@ jobs:
continue-on-error: true
- name: Setup Nix
uses: ./.github/actions/setup-nix
- - name: Configure Cachix fallback
- uses: ./.github/actions/setup-cachix
- with:
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build Lambda artifacts
run: .github/scripts/build-cloud-storage-lambdas-nix.sh
env:
diff --git a/.github/workflows/reusable_preview_service.yml b/.github/workflows/reusable_preview_service.yml
index 7dc4926da8..8137e35540 100644
--- a/.github/workflows/reusable_preview_service.yml
+++ b/.github/workflows/reusable_preview_service.yml
@@ -41,8 +41,6 @@ on:
required: true
DD_API_KEY:
required: true
- CACHIX_AUTH_TOKEN:
- required: true
jobs:
preview:
runs-on: namespace-profile-linux-small
@@ -75,7 +73,6 @@ jobs:
use-lfs: ${{ inputs.use-lfs }}
github-token: ${{ inputs.github-token }}
cloud-storage-service-name: ${{ inputs.service-name }}
- cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Teardown Nix
if: always()
uses: ./.github/actions/teardown-nix
diff --git a/.github/workflows/sdk-check.yml b/.github/workflows/sdk-check.yml
index 6e7b634d08..8e6d13dde2 100644
--- a/.github/workflows/sdk-check.yml
+++ b/.github/workflows/sdk-check.yml
@@ -84,6 +84,9 @@ jobs:
- name: Check endpoint coverage
run: bun run coverage
working-directory: packages/sdk
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-check
cancel-in-progress: true
diff --git a/.github/workflows/web-app-check-main.yml b/.github/workflows/web-app-check-main.yml
index 194d16345e..71c4475d10 100644
--- a/.github/workflows/web-app-check-main.yml
+++ b/.github/workflows/web-app-check-main.yml
@@ -116,6 +116,9 @@ jobs:
- name: Check Collaboration Package Types
run: bun run type-check
working-directory: packages/collaboration
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
biome-check:
needs:
- path-check
@@ -142,6 +145,9 @@ jobs:
- name: Run Collaboration Package Biome
run: biome ci --changed --no-errors-on-unmatched --error-on-warnings
working-directory: packages/collaboration
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
tailwind:
needs:
- path-check
@@ -166,6 +172,9 @@ jobs:
- name: Check Tailwind Classes
run: just check-tailwind
working-directory: apps/web
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
test:
needs:
- path-check
@@ -190,6 +199,9 @@ jobs:
- name: Test
run: bunx vitest
working-directory: apps/web
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
cycles:
needs:
- path-check
@@ -214,6 +226,9 @@ jobs:
- name: Collaboration Package Cycles Import Check
run: biome lint --changed --no-errors-on-unmatched --only=suspicious/noImportCycles
working-directory: packages/collaboration
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
build:
needs:
- path-check
@@ -236,6 +251,9 @@ jobs:
- name: Build
run: just build-dev
working-directory: apps/web
+ - name: Teardown Nix
+ if: always()
+ uses: './.github/actions/teardown-nix'
status-check:
needs:
- path-check
diff --git a/nix-support/node_modules-hashes.json b/nix-support/node_modules-hashes.json
index 567077a294..5961a44a6e 100644
--- a/nix-support/node_modules-hashes.json
+++ b/nix-support/node_modules-hashes.json
@@ -1,6 +1,6 @@
{
"nodeModules": {
- "aarch64-darwin": "sha256-aBAkpRkHflmOsUxj2mnlfDNvhVQfG4Y06AEMTL0uvpg=",
- "x86_64-linux": "sha256-ubQSIqNC5JY0jj/iD5k4vtZEXVCoJ7SFVayXomE8Px8="
+ "aarch64-darwin": "sha256-rkAFd6FOl3zek1zp+qnWdqfxSOIZooaewfJEVQYkGsI=",
+ "x86_64-linux": "sha256-yyIi9+SGgDW9/ZfaQFMBk9aAbehy/GwXC/7KzL+QE9I="
}
}
diff --git a/nix/cloud-storage.nix b/nix/cloud-storage.nix
index 66663663c2..2181225aa9 100644
--- a/nix/cloud-storage.nix
+++ b/nix/cloud-storage.nix
@@ -76,7 +76,7 @@
# manifest plus a crane stub target. A leaf's store hash then only
# moves when a crate it actually depends on changes — an email-only
# change leaves the other deploy derivations as pure substitutions
- # (sticky disk / Cachix) instead of full workspace-subgraph rebuilds.
+ # from Namespace's Nix cache instead of full workspace-subgraph rebuilds.
# Manifest or Cargo.lock changes still invalidate every leaf (the stub
# layer embeds them all); those are the rare structural commits.
#
@@ -188,7 +188,7 @@
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.gcc.cc}/lib/gcc/${pkgs.stdenv.hostPlatform.config}/${pkgs.gcc.version}/include";
};
- # Pre-built third-party deps — Cachix caches this; hash is driven by Cargo.lock
+ # Pre-built third-party deps cached by Namespace; hash is driven by Cargo.lock
# (workspace member sources are stubbed by crane), so it survives most PRs.
# --all-features matches the test job (cargo nextest --all-features) and clippy
# so all consumers share the same dep feature unification.
@@ -201,9 +201,10 @@
# Layered atop cargoArtifacts: pre-compile every workspace lib crate so
# downstream derivations (openApiBins, clippy) inherit a warm target/. The
- # hash is per-source so cachix only hits when the SHA matches across CI
- # workflows — but since code-check-cloud-storage and web-app-check-main both
- # run on the same SHA, whichever finishes first pushes for the other.
+ # hash is per-source so Namespace's Nix cache only hits when the SHA
+ # matches across CI workflows — but since code-check-cloud-storage and
+ # web-app-check-main both run on the same SHA, whichever finishes first
+ # populates the cache for the other.
# sync_service is checked separately with its supported default feature
# set because its KV and R2 storage features are mutually exclusive.
workspaceArtifacts = craneLib.cargoBuild (
@@ -312,7 +313,7 @@
# Pre-built nextest archive — packages all compiled test binaries plus their
# metadata into a single tar.zst. CI fetches this archive and runs
# `cargo nextest run --archive-file` outside the sandbox so tests can hit
- # postgres/redis services. Built in nix → cached by cachix.
+ # postgres/redis services. Built in Nix and cached by Namespace.
nextestArchive = craneLib.mkCargoDerivation (
commonArgs
// {
@@ -471,7 +472,7 @@
# ── Lambda builds (crane + cargo-zigbuild) ─────────────────────
# SPIKE: build a Rust Lambda handler reproducibly under nix/crane so
# lambdas ride the same content-addressed cache as the service binaries
- # (nix store + Cachix + sticky disk) instead of a cargo-in-checkout that
+ # (Namespace Nix store volume) instead of a cargo-in-checkout that
# recompiles the workspace every run. cargo-zigbuild pins the Lambda
# glibc via a target *suffix* (no toolchain swap; host triple == lambda
# triple, so no extra rust-std). The binary is renamed `bootstrap` and
diff --git a/tooling/xtask/crates/xtask_paths/src/test.rs b/tooling/xtask/crates/xtask_paths/src/test.rs
index f11ac9ba3f..334db9f2fc 100644
--- a/tooling/xtask/crates/xtask_paths/src/test.rs
+++ b/tooling/xtask/crates/xtask_paths/src/test.rs
@@ -16,7 +16,7 @@ fn typed_paths_validate_against_the_repository() {
repo_glob!("services/**/Cargo.toml")
.validate_at(&root)
.unwrap();
- repo_glob!(".github/actions/setup-cachix/**/*")
+ repo_glob!(".github/actions/setup-nix/**/*")
.validate_at(&root)
.unwrap();
assert_eq!(runtime_path!("artifacts/*").as_str(), "artifacts/*");
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/build_appimage_on_tag.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/build_appimage_on_tag.rs
index 0a9581e8a4..34d31e177b 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/build_appimage_on_tag.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/build_appimage_on_tag.rs
@@ -40,7 +40,6 @@ pub fn build_appimage_job(ref_expr: &str) -> Job {
.add_step(steps::checkout_ref(ref_expr))
.add_step(steps::mount_nix_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_cachix())
.add_step(steps::derive_artifact_metadata(ref_expr))
.add_step(nix_build_appimage())
.add_step(collect_appimage())
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs
index 2e2c5e232d..13c8a7447d 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/build_dmg_on_tag.rs
@@ -34,7 +34,6 @@ pub fn build_dmg_job(ref_expr: &str) -> Job {
.add_step(steps::checkout_ref(ref_expr))
.add_step(assert_arm64())
.add_step(install_nix_macos())
- .add_step(steps::setup_cachix())
.add_step(configure_signing_identity())
.add_step(steps::derive_artifact_metadata(ref_expr))
.add_step(nix_build_dmg())
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/cargo_workspace_dependency_check.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/cargo_workspace_dependency_check.rs
index 6bceed8815..be25f3463f 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/cargo_workspace_dependency_check.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/cargo_workspace_dependency_check.rs
@@ -56,7 +56,7 @@ fn rust_ci_job() -> Job {
.add_step(checkout())
.add_step(steps::mount_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_cachix_dev_shell())
+ .add_step(steps::setup_dev_shell())
.add_step(steps::configure_namespace_sccache(vars::CI_SCCACHE_NAME))
}
@@ -64,6 +64,7 @@ fn dependency_check() -> Job {
rust_ci_job()
.add_step(install_checker())
.add_step(run_checker())
+ .add_step(steps::teardown_nix())
}
/// The workspace-hack crate pins every third-party dep to its union feature
@@ -75,7 +76,9 @@ fn dependency_check() -> Job {
/// lock-pinned engine in tooling/xtask; this job rejects
/// drift. Regenerate locally with `just hakari` from the repository root.
fn hakari_and_dep_closures() -> Job {
- rust_ci_job().add_step(deps_check())
+ rust_ci_job()
+ .add_step(deps_check())
+ .add_step(steps::teardown_nix())
}
fn checkout() -> Step<Use> {
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/check_node_modules_nix.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/check_node_modules_nix.rs
index 8fd785bb53..b1720d8965 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/check_node_modules_nix.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/check_node_modules_nix.rs
@@ -51,9 +51,10 @@ fn check_linux_node_modules_nix() -> Job {
.name("check Linux node_modules nix")
.runs_on(runners::Runner::Small.to_string())
.add_step(steps::checkout(false, false))
+ .add_step(steps::mount_nix_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_cachix())
.add_step(verify_node_modules_nix())
+ .add_step(steps::teardown_nix())
}
fn check_darwin_node_modules_nix() -> Job {
@@ -63,7 +64,6 @@ fn check_darwin_node_modules_nix() -> Job {
.add_step(steps::checkout(false, false))
.add_step(assert_arm64())
.add_step(install_nix_macos())
- .add_step(steps::setup_cachix())
.add_step(verify_node_modules_nix())
}
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
index 4fc4268652..874462652a 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
@@ -69,12 +69,13 @@ fn check() -> Job {
.add_step(steps::checkout(false, false))
.add_step(steps::mount_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_cachix_dev_shell())
+ .add_step(steps::setup_dev_shell())
.add_step(steps::configure_namespace_sccache(vars::CI_SCCACHE_NAME))
.add_step(validate_doppler_configs())
.add_step(cargo_fmt())
.add_step(cargo_clippy())
.add_step(steps::show_sccache_stats())
+ .add_step(steps::teardown_nix())
}
/// cargo nextest against postgres + redis service containers.
@@ -92,12 +93,13 @@ fn test() -> Job {
.add_step(steps::checkout(false, false))
.add_step(steps::mount_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_cachix_dev_shell())
+ .add_step(steps::setup_dev_shell())
.add_step(steps::configure_namespace_sccache(vars::CI_SCCACHE_NAME))
.add_step(configure_postgres())
.add_step(prepare_tests())
.add_step(run_tests())
.add_step(steps::show_sccache_stats())
+ .add_step(steps::teardown_nix())
}
/// Always-run collector used as the required status check. Its name must stay
@@ -145,7 +147,9 @@ fn paths_filter() -> Step<gh_workflow::Use> {
- 'static_assets/**'
- 'flake.nix'
- 'flake.lock'
- - '.github/actions/setup-cachix/**'
+ - '.github/actions/setup-nix/**'
+ - '.github/actions/setup-nix-dev-shell/**'
+ - '.github/actions/teardown-nix/**'
- '.github/actions/setup-sccache/**'
- '.github/services-config.json'
- '.github/scripts/build-cloud-storage-lambdas.sh'
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_conventions.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_conventions.rs
index 9541e6d690..870ec3dd41 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_conventions.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_conventions.rs
@@ -62,6 +62,7 @@ fn ast_grep() -> Job {
.add_step(steps::setup_nix())
.add_step(steps::setup_dev_shell())
.add_step(run_ast_grep())
+ .add_step(steps::teardown_nix())
}
/// Always-run collector used as the required status check. Its name must stay
@@ -94,6 +95,7 @@ fn paths_filter() -> Step<Use> {
- 'packages/**'
- 'rules/**'
- 'sgconfig.yml'
+ - '.github/actions/teardown-nix/**'
- '.github/workflows/code_check_conventions.yml'
"#},
))
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_infra.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_infra.rs
index 8798e4eec3..4d67dc8b76 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_infra.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_infra.rs
@@ -61,6 +61,7 @@ fn biome_check() -> Job {
.add_step(steps::setup_nix())
.add_step(steps::setup_dev_shell())
.add_step(run_biome())
+ .add_step(steps::teardown_nix())
}
fn check() -> Job {
@@ -72,6 +73,7 @@ fn check() -> Job {
.add_step(steps::setup_dev_shell())
.add_step(bun_install())
.add_step(bun_check())
+ .add_step(steps::teardown_nix())
}
/// Always-run collector used as the required status check. Its name must stay
@@ -115,6 +117,7 @@ fn paths_filter() -> Step<Use> {
- 'flake.nix'
- 'flake.lock'
- '.github/actions/setup-nix-dev-shell/**'
+ - '.github/actions/teardown-nix/**'
- '.github/workflows/code_check_infra.yml'
"#},
))
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_all_services.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_all_services.rs
index 5859abe8fa..3d50cfc8a8 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_all_services.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_all_services.rs
@@ -105,8 +105,6 @@ pub fn patch(root: &mut serde_yaml::Value) -> Result<()> {
required: true
DD_API_KEY:
required: true
- CACHIX_AUTH_TOKEN:
- required: true
"#})?,
);
Ok(())
@@ -147,8 +145,7 @@ fn set_matrix() -> Step<Run> {
/// Warm one shared dep closure onto the /nix sticky disk. The two warm jobs
/// run in parallel and each build matrix depends only on its own warm job, so
/// a slow lambda-closure warm never blocks binary builds and vice versa. The
-/// /nix cache volume is an optimization; Cachix is the consistency backstop
-/// either way.
+/// /nix cache volume is provided by Namespace's native Nix integration.
fn warm_job(
name: &str,
gate_output: &str,
@@ -166,14 +163,13 @@ fn warm_job(
.add_step(steps::checkout_v4())
.add_step(steps::mount_nix_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_cachix())
- .add_step(steps::nix_build_watched(build_step_name, targets, done_msg))
+ .add_step(steps::nix_build(build_step_name, targets, done_msg))
.add_step(steps::teardown_nix())
}
/// Base for the per-service build matrix jobs: clones the warm /nix cache
/// volume populated by the matching warm job, so only each service's own
-/// crate compiles (cold volume -> Cachix substitution). No max-parallel:
+/// crate compiles. No max-parallel:
/// runners autoscale, so all services build concurrently.
fn build_job(name: &str, warm_job_id: &str, gate_output: &str) -> Job {
Job::default()
@@ -193,7 +189,6 @@ fn build_job(name: &str, warm_job_id: &str, gate_output: &str) -> Job {
.add_step(steps::checkout_v4().add_with(("clean", false)))
.add_step(steps::mount_nix_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_cachix())
}
fn build_service_binaries() -> Job {
@@ -211,7 +206,8 @@ fn build_service_binaries() -> Job {
}
fn build_prebuilt_binaries() -> Step<Run> {
- let script = steps::with_cachix_watch(indoc::indoc! {r#"
+ let script = indoc::indoc! {r#"
+ set -euo pipefail
mkdir -p prebuilt
nix build --print-build-logs ".#deploy-service-binaries-${SERVICE}"
cp -r result/bin/* prebuilt/
@@ -223,7 +219,7 @@ fn build_prebuilt_binaries() -> Step<Run> {
tar -C prebuilt -czf prebuilt-binaries.tar.gz .
# Receipt: the deploy job logs the same hash on read.
echo "handoff receipt: $(sha256sum prebuilt-binaries.tar.gz | cut -d' ' -f1) ($(stat -c%s prebuilt-binaries.tar.gz) bytes)"
- "#});
+ "#};
Step::new("Build prebuilt binaries")
.run(script)
.shell("bash")
@@ -233,7 +229,7 @@ fn build_prebuilt_binaries() -> Step<Run> {
/// Each handler is a crane + cargo-zigbuild nix package. This job builds all
/// of a service's handlers via `nix build .#deploy-lambda-<name>`, cloning the
/// warm lambda /nix disk committed by warm-lambdas. Unchanged handlers are
-/// pure cache hits (substituted from the disk/Cachix, no recompile).
+/// pure cache hits from the Namespace Nix volume (no recompile).
fn build_lambda_artifacts() -> Job {
build_job(
"Build ${{ matrix.service }} Lambda artifacts",
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_cloud_storage_on_push.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_cloud_storage_on_push.rs
index b1b07518a0..d8fa18abcd 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_cloud_storage_on_push.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_cloud_storage_on_push.rs
@@ -56,7 +56,6 @@ pub fn deploy_cloud_storage_on_push() -> Workflow {
))
.add_path(xtask_paths::repo_glob!(".github/actions/setup-nix/**"))
.add_path(xtask_paths::repo_glob!(".github/actions/teardown-nix/**"))
- .add_path(xtask_paths::repo_glob!(".github/actions/setup-cachix/**"))
.add_path(xtask_paths::repo_glob!(
".github/actions/migrate-cloud-storage-db/**"
))
@@ -90,7 +89,6 @@ pub fn patch(root: &mut serde_yaml::Value) -> Result<()> {
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
DD_APP_KEY: ${{ secrets.DD_APP_KEY }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
- CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
"#})?,
);
Ok(())
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_preview.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_preview.rs
index 89fb7a2a5c..814254cb82 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_preview.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_preview.rs
@@ -59,6 +59,7 @@ fn deploy() -> Job {
.add_step(validate_bucket_name())
.add_step(deploy_to_s3())
.add_step(comment_on_pr())
+ .add_step(steps::teardown_nix())
}
fn checkout() -> Step<Use> {
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app.rs
index d4c5ff3eeb..6969bda417 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/deploy_web_app.rs
@@ -35,8 +35,8 @@ pub fn deploy_web_app() -> Workflow {
/// Fill in the ordered dispatch/call input blocks.
///
-/// Relative to the hand-written workflow this drops the `SCCACHE_BUCKET`
-/// secret: the build runs sccache against the web-ci cache volume, not S3.
+/// The build uses the shared Namespace `web-ci` sccache cache, so no sccache
+/// backend secret is needed here.
pub fn patch(root: &mut serde_yaml::Value) -> Result<()> {
let on = root
.get_mut("on")
@@ -104,6 +104,7 @@ fn build_deploy() -> Job {
.add_step(pulumi_up())
.add_step(upload_sourcemaps())
.add_step(upload_production_build())
+ .add_step(steps::teardown_nix())
}
fn checkout() -> Step<Use> {
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/preview_fly.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/preview_fly.rs
index 5e93e83d1a..f6bb7dd840 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/preview_fly.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/preview_fly.rs
@@ -142,6 +142,7 @@ fn deploy() -> Job {
.add_step(dump_boot_timings())
.add_step(publish_template_volume())
.add_step(comment_preview_url())
+ .add_step(steps::teardown_nix())
}
/// When the machine never passes its health check, the answer is inside the
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/pulumi_preview_pr.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/pulumi_preview_pr.rs
index 48d43b1f9c..e6959f38e3 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/pulumi_preview_pr.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/pulumi_preview_pr.rs
@@ -46,7 +46,8 @@ pub fn pulumi_preview_pr() -> Workflow {
.add_path(xtask_paths::repo_glob!(
".github/actions/preview-cloud-storage-pulumi/**"
))
- .add_path(xtask_paths::repo_glob!(".github/actions/setup-cachix/**"))
+ .add_path(xtask_paths::repo_glob!(".github/actions/setup-nix/**"))
+ .add_path(xtask_paths::repo_glob!(".github/actions/teardown-nix/**"))
.add_path(xtask_paths::repo_glob!(
".github/scripts/build-cloud-storage-lambdas-nix.sh"
))
@@ -168,7 +169,8 @@ fn changed_files() -> Step<Use> {
.github/workflows/pulumi_preview_pr.yml
.github/workflows/reusable_preview_service.yml
.github/actions/preview-cloud-storage-pulumi/**
- .github/actions/setup-cachix/**
+ .github/actions/setup-nix/**
+ .github/actions/teardown-nix/**
.github/scripts/build-cloud-storage-lambdas-nix.sh
.github/services-config.json
"#}
@@ -212,7 +214,8 @@ fn detect_affected_services() -> Step<Run> {
"$file" == ".github/workflows/pulumi_preview_pr.yml" || \
"$file" == ".github/workflows/reusable_preview_service.yml" || \
"$file" == .github/actions/preview-cloud-storage-pulumi/* || \
- "$file" == .github/actions/setup-cachix/* || \
+ "$file" == .github/actions/setup-nix/* || \
+ "$file" == .github/actions/teardown-nix/* || \
"$file" == ".github/scripts/build-cloud-storage-lambdas-nix.sh" ]]; then
service_changed=true
break
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_deploy_service.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_deploy_service.rs
index ce39cf2172..905f9abee0 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_deploy_service.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_deploy_service.rs
@@ -8,8 +8,7 @@
//! deploy-all-services warms a shared dep closure once and fans a build
//! matrix out across it; with a single service there is no fan-out to
//! amortise, so the per-service build realises its own closure directly (the
-//! /nix sticky disk + Cachix still substitute everything unchanged from
-//! prior runs).
+//! /nix sticky disk still substitutes everything unchanged from prior runs).
use anyhow::Result;
use gh_workflow::{Env, Event, Expression, Job, Run, Step, Use, Workflow, WorkflowCall};
@@ -70,8 +69,6 @@ pub fn patch(root: &mut serde_yaml::Value) -> Result<()> {
required: true
DD_API_KEY:
required: true
- CACHIX_AUTH_TOKEN:
- required: true
"#})?,
);
Ok(())
@@ -105,7 +102,7 @@ fn check_artifact_config() -> Step<Run> {
.add_env(Env::new("SERVICE", "${{ inputs.service-name }}"))
}
-/// Base for the two nix build jobs: warm /nix volume + Nix + Cachix fallback.
+/// Base for the two Nix build jobs using Namespace's warm `/nix` volume.
fn build_job(name: &str, gate_output: &str) -> Job {
Job::default()
.name(name)
@@ -117,7 +114,6 @@ fn build_job(name: &str, gate_output: &str) -> Job {
.add_step(steps::checkout_v4().add_with(("clean", false)))
.add_step(steps::mount_nix_cache_volume())
.add_step(steps::setup_nix())
- .add_step(steps::setup_cachix())
}
fn build_service_binaries() -> Job {
@@ -131,7 +127,8 @@ fn build_service_binaries() -> Job {
}
fn build_prebuilt_binaries() -> Step<Run> {
- let script = steps::with_cachix_watch(indoc::indoc! {r#"
+ let script = indoc::indoc! {r#"
+ set -euo pipefail
mkdir -p prebuilt
nix build --print-build-logs ".#deploy-service-binaries-${SERVICE}"
cp -r result/bin/* prebuilt/
@@ -143,7 +140,7 @@ fn build_prebuilt_binaries() -> Step<Run> {
tar -C prebuilt -czf prebuilt-binaries.tar.gz .
# Receipt: the deploy job logs the same hash on read.
echo "handoff receipt: $(sha256sum prebuilt-binaries.tar.gz | cut -d' ' -f1) ($(stat -c%s prebuilt-binaries.tar.gz) bytes)"
- "#});
+ "#};
Step::new("Build prebuilt binaries")
.run(script)
.shell("bash")
@@ -153,7 +150,7 @@ fn build_prebuilt_binaries() -> Step<Run> {
/// Each handler is a crane + cargo-zigbuild nix package; the build script
/// runs `nix build .#deploy-lambda-<name>` for the service's handlers.
/// Unchanged handlers are pure cache hits (substituted from the /nix disk or
-/// Cachix).
+/// the Namespace Nix cache volume).
fn build_lambda_artifacts() -> Job {
build_job(
"Build ${{ inputs.service-name }} Lambda artifacts",
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_preview_service.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_preview_service.rs
index 3ce7969b22..24dbdc6867 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_preview_service.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/reusable_preview_service.rs
@@ -6,7 +6,7 @@
//! The preview job is pulumi-preview + occasional Lambda Nix builds (warm runs
//! are pure cache substitution), so `linux-small` suffices; it mounts the
//! profile's default `/nix` volume, with `setup-nix` before use and
-//! `teardown-nix` after. Cold Lambda closures fall back to Cachix.
+//! `teardown-nix` after.
use anyhow::Result;
use gh_workflow::{Event, Job, Step, Use, Workflow, WorkflowCall};
@@ -23,9 +23,8 @@ pub fn reusable_preview_service() -> Workflow {
/// Fill in the ordered `workflow_call` inputs/secrets block.
///
-/// Relative to the hand-written workflow this drops the `SCCACHE_BUCKET`
-/// secret and its pass-through: Lambda artifacts build inside Nix derivations,
-/// where S3 sccache never applied (the sole caller uses `secrets: inherit`, so
+/// Lambda artifacts build inside Nix derivations, so this workflow does not
+/// need a separate sccache secret (the sole caller uses `secrets: inherit`, so
/// no caller change is needed).
pub fn patch(root: &mut serde_yaml::Value) -> Result<()> {
let on = root
@@ -73,8 +72,6 @@ pub fn patch(root: &mut serde_yaml::Value) -> Result<()> {
required: true
DD_API_KEY:
required: true
- CACHIX_AUTH_TOKEN:
- required: true
"#})?,
);
Ok(())
@@ -127,5 +124,4 @@ fn preview_pulumi() -> Step<Use> {
.add_with(("use-lfs", "${{ inputs.use-lfs }}"))
.add_with(("github-token", "${{ inputs.github-token }}"))
.add_with(("cloud-storage-service-name", "${{ inputs.service-name }}"))
- .add_with(("cachix-auth-token", "${{ secrets.CACHIX_AUTH_TOKEN }}"))
}
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/build_appimage.sh b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/build_appimage.sh
index 654483696b..1a6f62766d 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/build_appimage.sh
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/build_appimage.sh
@@ -1,10 +1,4 @@
set -euo pipefail
-cachix_pid=
-if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${cachix_pid:-}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
-fi
restart_nix_daemon() {
echo "::warning::Restarting nix-daemon before retrying AppImage build."
sudo systemctl restart nix-daemon.service 2>/dev/null || true
@@ -54,6 +48,3 @@ for attempt in 1 2 3; do
restart_nix_daemon
sleep $((attempt * 10))
done
-if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix push "$CACHIX_CACHE_NAME" result || echo "::warning::Failed to push AppImage result closure to Cachix."
-fi
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/build_dmg.sh b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/build_dmg.sh
index f2aded86ab..c36b3793a1 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/build_dmg.sh
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/build_dmg.sh
@@ -1,11 +1,2 @@
set -euo pipefail
-cachix_pid=
-if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${cachix_pid:-}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
-fi
nix build --impure --option sandbox false --print-build-logs ".#packages.aarch64-darwin.tauri-desktop-dmg"
-if command -v cachix >/dev/null 2>&1 && [ -n "${CACHIX_CACHE_NAME:-}" ]; then
- cachix push "$CACHIX_CACHE_NAME" result || echo "::warning::Failed to push DMG result closure to Cachix."
-fi
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/compute_nextest_filter.sh b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/compute_nextest_filter.sh
index a2f74077bf..0bec1c6f6b 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/compute_nextest_filter.sh
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/compute_nextest_filter.sh
@@ -5,7 +5,7 @@ set -euo pipefail
# live Postgres (SQLX_OFFLINE is unset there), so `.sqlx` contents cannot change
# test outcomes, and a query change always comes with a source change in the
# owning crate, which the package filter below already maps.
-if grep -qE '^(Cargo\.(toml|lock)|rust-toolchain\.toml|Cross\.toml|clippy\.toml|deny\.toml|\.cargo/.*|\.config/.*|flake\.nix|flake\.lock|\.github/actions/(setup-rust|setup-cachix|setup-sccache)/.*|\.github/workflows/code_check_cloud_storage\.yml)$' /tmp/changed-files; then
+if grep -qE '^(Cargo\.(toml|lock)|rust-toolchain\.toml|Cross\.toml|clippy\.toml|deny\.toml|\.cargo/.*|\.config/.*|flake\.nix|flake\.lock|\.github/actions/(setup-rust|setup-nix|setup-nix-dev-shell|setup-sccache)/.*|\.github/workflows/code_check_cloud_storage\.yml)$' /tmp/changed-files; then
echo "Workspace-level change detected; running all tests"
echo "nextest_filter=" >> "$GITHUB_OUTPUT"
exit 0
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/sdk_check.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/sdk_check.rs
index 5663e5ff28..ab9732ec8b 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/sdk_check.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/sdk_check.rs
@@ -42,6 +42,7 @@ fn check_sdk() -> Job {
.add_step(verify_fresh())
.add_step(typecheck())
.add_step(check_coverage())
+ .add_step(steps::teardown_nix())
}
fn update_generated() -> Step<Run> {
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs
index 08ae28d9cb..027a0a995d 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs
@@ -105,17 +105,6 @@ pub fn setup_dev_shell() -> Step<Use> {
)
}
-/// Configure Cachix and enter the repo's Nix dev shell. This is retained for
-/// workflow families that have not yet migrated to Namespace's Nix cache.
-pub fn setup_cachix_dev_shell() -> Step<Use> {
- uses_local(
- "Setup Nix dev shell",
- xtask_paths::repo_dir!(".github/actions/setup-cachix"),
- )
- .add_with(("cachix-auth-token", vars::CACHIX_AUTH_TOKEN))
- .add_with(("dev-shell", "true"))
-}
-
/// Mount the Namespace profile's persisted cache volume: `cache: rust` persists
/// the cargo registry/git, and `path:` persists the Nix store. Compiled objects
/// deliberately use Namespace's official remote sccache instead of this volume.
@@ -296,32 +285,13 @@ pub fn checkout_v4() -> Step<Use> {
.add_with(("persist-credentials", false))
}
-/// Wrap a shell fragment in the standard Cachix watch-store lifecycle.
-///
-/// The watcher is optional and always cleaned up, so Nix builds still succeed
-/// when Cachix is unavailable while every deploy-family caller shares the same
-/// process and trap semantics.
-pub fn with_cachix_watch(inner: &str) -> String {
- indoc::formatdoc! {r#"
- set -euo pipefail
- cachix_pid=
- if command -v cachix >/dev/null 2>&1 && [ -n "${{CACHIX_CACHE_NAME:-}}" ]; then
- cachix watch-store "$CACHIX_CACHE_NAME" >/tmp/cachix-watch-store.log 2>&1 &
- cachix_pid=$!
- trap 'if [ -n "${{cachix_pid:-}}" ]; then kill "$cachix_pid" 2>/dev/null || true; wait "$cachix_pid" 2>/dev/null || true; fi' EXIT
- fi
- {inner}
- "#}
-}
-
-/// `nix build` wrapped in `cachix watch-store`, so realised store paths are
-/// pushed to Cachix as they build — the consistency backstop when the /nix
-/// volume is cold or evicted.
-pub fn nix_build_watched(name: &str, targets: &str, done_msg: &str) -> Step<Run> {
- let script = with_cachix_watch(&format!(
- "nix build --print-build-logs {targets}\necho \"{done_msg}\""
- ));
- Step::new(name).run(script).shell("bash")
+/// Build Nix targets using Namespace's mounted `/nix` cache volume.
+pub fn nix_build(name: &str, targets: &str, done_msg: &str) -> Step<Run> {
+ Step::new(name)
+ .run(format!(
+ "set -euo pipefail\nnix build --print-build-logs {targets}\necho \"{done_msg}\""
+ ))
+ .shell("bash")
}
/// Upload a build's handoff tarball to Namespace artifact storage: strongly
@@ -383,15 +353,6 @@ pub fn mount_nix_cache_volume() -> Step<Use> {
nscloud_cache_action("Mount /nix cache volume").add_with(("cache", "nix"))
}
-/// Configure Cachix (without entering a dev shell).
-pub fn setup_cachix() -> Step<Use> {
- uses_local(
- "Configure Cachix fallback",
- xtask_paths::repo_dir!(".github/actions/setup-cachix"),
- )
- .add_with(("cachix-auth-token", vars::CACHIX_AUTH_TOKEN))
-}
-
/// Derive a safe tag name from the git ref for use in artifact names.
pub fn derive_artifact_metadata(raw_ref_expr: &str) -> Step<Run> {
Step::new("Derive artifact metadata")
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs
index db6e6759d3..ab2749604a 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/vars.rs
@@ -13,7 +13,6 @@ macro_rules! secret {
secret!(AWS_ACCESS_KEY);
secret!(AWS_SECRET_ACCESS_KEY);
-secret!(CACHIX_AUTH_TOKEN);
secret!(CLOUDFLARE_API_TOKEN);
secret!(DD_API_KEY);
secret!(DD_APP_KEY);
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs
index 274b58f6eb..34b83671fc 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/web_app_check_main.rs
@@ -79,6 +79,7 @@ fn typescript() -> Job {
.add_step(show_sccache_stats())
.add_step(check_types())
.add_step(check_collaboration_types())
+ .add_step(steps::teardown_nix())
}
fn biome_check() -> Job {
@@ -89,6 +90,7 @@ fn biome_check() -> Job {
.add_step(steps::setup_dev_shell())
.add_step(run_biome())
.add_step(run_collaboration_biome())
+ .add_step(steps::teardown_nix())
}
fn tailwind() -> Job {
@@ -98,6 +100,7 @@ fn tailwind() -> Job {
.add_step(steps::setup_nix())
.add_step(steps::setup_reqs_web("Setup Prereqs", false))
.add_step(check_tailwind_classes())
+ .add_step(steps::teardown_nix())
}
fn test() -> Job {
@@ -107,6 +110,7 @@ fn test() -> Job {
.add_step(steps::setup_nix())
.add_step(steps::setup_reqs_web("Setup", true))
.add_step(run_tests())
+ .add_step(steps::teardown_nix())
}
fn cycles() -> Job {
@@ -117,6 +121,7 @@ fn cycles() -> Job {
.add_step(steps::setup_dev_shell())
.add_step(cycles_import_check())
.add_step(collaboration_cycles_import_check())
+ .add_step(steps::teardown_nix())
}
fn build() -> Job {
@@ -126,6 +131,7 @@ fn build() -> Job {
.add_step(steps::setup_nix())
.add_step(steps::setup_reqs_web("Setup", false))
.add_step(run_build())
+ .add_step(steps::teardown_nix())
}
/// Always-run collector used as the required status check. Its name must stay