Expand description
Built-in binary cache server and push pipeline for sui.
Replaces Attic, Cachix, and nix-serve with a single integrated component. Implements the standard Nix binary cache HTTP protocol (narinfo + NAR).
§Architecture
sui_castore— pluggable storage backends (shared with sui-registry); re-exported from here for backward compatibility.server— axum HTTP server implementing the cache protocolsigning— ed25519 key management and narinfo signingpush— pipeline to push store paths to the cachegc— garbage collection of unreferenced cache entriesconfig— cache configuration types (CacheConfig; BackendConfig is in sui-castore)
Re-exports§
pub use config::CacheConfig;pub use gc::GcResult;pub use push::PushResult;pub use server::build_router;pub use server::serve;pub use server::AppState;pub use signing::verify_narinfo_signature;pub use signing::CacheSigner;
Modules§
- config
- Cache configuration types.
- gc
- Garbage collection for the binary cache.
- push
- Push pipeline — build output to NAR to sign to upload.
- server
- Axum HTTP server implementing the Nix binary cache protocol.
- signing
- Ed25519 signing for narinfo metadata.
Structs§
- Local
Storage - Filesystem-backed binary cache storage.
- PgStorage
Backend - L2 durable cache tier: content-addressed key → value over Postgres, shared across pods, survives a roll.
- Redis
Backend - L1 hot cache: content-addressed key → value, sub-ms hits, TTL/eviction-aware.
- S3Storage
- S3-compatible object storage backend.
- Storage
Index - Ephemeral metadata index backed by redb.
- Tiered
Backend - Three-tier read-through / write-through cache resolver.
Enums§
- Backend
Config - Storage backend selection.
- Cache
Error CacheErroris nowsui_castore::StoreError(same variants, same derives). This type alias preserves every existingsui_cache::CacheErroruse site. Error type for content-addressed store operations.- PgTable
- The two logical tables the cache tier keeps: narinfo text and NAR blobs.
- Tiered
Tier - The honest self-description of what
TieredBackendhas been proven against — asserted by the honest gate so a claim cannot be silently rounded up. - Write
Policy - How a
putpropagates across the tiers. See the module docs for the full contract; every policy persists both durable tiers before returning.
Constants§
- TIERED_
BACKEND_ TIER - The shipped tier of
TieredBackend. Asserted by the honest gate; bumping it toLiveClusterProvenwithout a live integration test is a build-failing round-up.
Traits§
- PgCache
Conn - The minimal typed Postgres row-verb surface
PgStorageBackenddepends on. - Redis
Conn - The minimal async redis verb surface
RedisBackenddepends on. - Storage
Backend - Abstraction over binary cache storage.
Functions§
- build_
backend - Config-select factory: build the concrete
StorageBackendaBackendConfignames.