Concept

The store

The short version

The store holds immutable programs and system trees under /sigil/store. A generation points to a system tree rather than copying all its packages. Two generations can share unchanged items while keeping different versions of a package side by side. Runtime state, including private keys and databases, lives outside those immutable trees.

Two ways an item gets its name

A package's identity hashes its recipe and dependencies. Its realized store path also depends on the builder's derivation record, including toolchain outputs and sandbox mode. The package identity alone doesn't tell you the final path. The build records which item a package realized to.

System and tools trees use a content-derived name. Vessel serializes names, file contents, executable bits and link targets, with a label and hash domain; owners and timestamps aren't included. Equal trees with the same label get the same name. Package output paths and content tree names are different addressing schemes, even though both start with a hash.

The closure keeps a system together

A system item's closure lists what it needs from the store. The builder starts from its kernel, packages and tools and scans file contents and link targets for complete store paths, following those references transitively. A reference to a missing item is an error. A program that constructs paths from pieces at runtime can escape this scan, so the closure isn't an arbitrary program analysis.

Removing a generation drops one reason to keep those items. Collection protects remaining generations and their closures, boot-entry systems and the running system; items outside that retained set can be deleted. Today's collector doesn't keep arbitrary user profiles alive. The planned user-root registry is part of the store service design, not an available feature.

Read-only programs, writable state

Activation bind-mounts the live store read-only. The root filesystem itself is writable, and /run and /tmp are temporary filesystems. State directories under /var survive generation changes. Rolling back programs doesn't roll back a database migration or restore a secret.

The generation tool writes through a separate writable mount when managing items. Its current receive path validates archive structure but doesn't authenticate package outputs: an accepted first upload can occupy a name. It isn't an unprivileged shared-store admission service.

The proposed store service would check content addresses or authorized output bindings and keep users' retention roots. It would admit bytes, not evaluate configurations, build packages or activate a system. Neither the service nor its client exists yet.

In practice

Read Generations for what retains an old system and Substitutes for the planned way to obtain package bytes. A guide to freeing disk space is still to come. Until then, keep in mind that the collector keeps only what the generations, boot entries and running system need: a store item you made yourself can be deleted.

Created with Sigil