Concept

How system.sgl becomes a system

The short version

A system configuration is a Sigil value describing a machine. Composing its features gives a checked system value; building that value realizes its packages and writes one immutable system item. Installing the item gives it a generation number and a trial boot entry. These are separate operations: evaluating a configuration doesn't build packages or change the running machine.

From a program to a checked value

The file name system.sgl is a convention. The useful part is the value the program produces. The system-configuration record holds facts such as the host name, disks, accounts and features. Packages are imported Sigil values, so an unknown binding fails during evaluation.

The function compose-system sends the configuration's fields and its features' contributions to receivers, then validates the resulting system. It checks such things as account conflicts, service dependencies and reserved kernel parameters before the build. Record construction alone doesn't do this: even a misspelled configuration field can survive construction today. The Features page shows a configuration and what composing it gives.

A program can also produce a system record directly. The builder converts that shorthand to a configuration and composes it. A previously composed system keeps its source and composition; changing its derived fields behind the composition's back is refused when it is resolved.

From packages to a system item

The realizer builds each package and its dependencies using the channel build engine. The system builder combines the realized programs into a profile, rejects conflicting profile entries, and writes the configuration files and service definitions. Its result contains the kernel link, kernel parameters, an init program, profile, etc and a closure listing the store items it needs. Missing store references fail the build.

The item gets a name derived from its tree. Nothing has booted yet. The separate system.lock records the supplied snapshot and configuration identifiers, package identities and realized item names, and the resulting system item. It names generated files through the item rather than copying their contents. The lock writer doesn't itself authenticate a channel.

From an item to a booted generation

The generation tool installs a system item as a numbered generation and writes its boot entry. At boot, activation makes the store read-only and links the selected system's profile and configuration into the running filesystem. The service manager then starts the services. The health check accepts or rejects the trial, as Generations explains.

On an installed system, vessel system apply does all three steps for the configuration file you give it, as in vessel system apply /etc/vessel/system.sgl. It evaluates the file, including its feature list, builds the system item, and installs it as a trial generation for the next boot. It never restarts the computer. It builds only from the packages already on the computer, so a feature that needs other packages can't be built that way yet. A project file holding several machines' configurations, with its own pinned inputs, has been proposed, but isn't built.

In practice

Read Features for composition and the generated system-configuration reference for its fields. The installation tutorial describes the installer path and its current limits; The store explains what the build leaves behind.

Created with Sigil