Skip to content

System configuration ​

Every field of the system configuration, with its type and default, as the schema in crates/laft-config/stav/prelude/system.stav declares it. laft options prints the same list on a machine.

Types are Stav types. Option<T> fields may be left out, Set<T> and List<T> are written as lists, and Map<Str, T> fields with a block keyword are written as labeled blocks: the services map is written as service <name> { ... } blocks. Ref<User> and Ref<Group> name a declared account. Pkg is a package reference and Path a path literal relative to the file. Data is any value that the target format can hold. See the Stav reference for the type syntax and where refinements.

Values from the base part and the std catalog are defaults that any plain assignment replaces. The defaults below are those of the schema itself.

The system block ​

Every configuration has one system block, and every field below lives in it.

System ​

Everything that describes one machine.

FieldTypeDefaultMeaning
hostnameStr where hostname"laft"The host name: one label of a-z, 0-9 and -, at most 63 characters, not starting or ending with -.
timezoneStr where matches(r"[A-Za-z0-9_+-]+(/[A-Za-z0-9_+-]+)*")"UTC"The IANA time zone name, for example "Europe/Berlin".
localeStr where nonEmpty"C.UTF-8"The value of LANG for logins and services.
extra_localesSet<Str>[]More locales that must be available, for example "de_DE.UTF-8".
keymapOption<Str where matches(r"[A-Za-z0-9._-]+")>The console keymap for loadkeys, for example "de-latin1".
console_fontOption<Str where matches(r"[A-Za-z0-9._-]+")>The console font for setfont, for example "ter-v22n".
usersUsersUsers {}The declared accounts.
sessionSessionSession {}Login session tracking.
filesMap<Str, File>{}Files in /etc. Block label: the absolute path. Written as file blocks.
kernelKernelKernel {}Kernel modules to load, blacklist and configure.
sysctlMap<Str, Data>{}Kernel parameters by key, for example "vm.swappiness". Values are integers, strings or booleans.
reposMap<Str, Repo>{}Package repositories. Block label: the repository name. Written as repo blocks.
packagesSet<Pkg>[]Packages in the system view.
alternativesMap<Str, Pkg>{}The chosen member of each alternatives group, for the system view.
viewsMap<Str, View>{}Views besides the system view. Block label: the view name. Written as view blocks.
gcGcGc {}Retention of generations and automatic collection.
bootBootBoot {}The boot loader, kernel, boot counting and initramfs.
fsMap<Str, Fs>{}Mounted filesystems. Block label: the mountpoint. Written as fs blocks.
swapMap<Str, Swap>{}Swap devices. Block label: the device. Written as swap blocks.
luksMap<Str, Luks>{}LUKS devices unlocked in the initramfs. Block label: the device-mapper name. Written as luks blocks.
initInitrunitThe init system.
servicesMap<Str, Service>{}System services. Block label: the service name. Written as service blocks.
gettyGettyGetty {}The terminals that get a login prompt.
securitySecuritySecurity {}Files that keep setuid, setgid or file capabilities.

Accounts ​

Users ​

Account settings.

FieldTypeDefaultMeaning
mutableBooltruetrue: accounts created outside Laft are kept. false: the account databases contain exactly the declared accounts.
accountsMap<Str, User>{}Users. Block label: the user name. Written as user blocks.
groupsMap<Str, Group>{}Groups. Block label: the group name. Written as group blocks.

User ​

A user account. Block label: the user name.

FieldTypeDefaultMeaning
uidOption<Int where 0..=65534>Allocated when none.
groupOption<Ref<Group>>The primary group. none: a group with the user's name, created when it is not declared.
groupsSet<Ref<Group>>[]Supplementary groups.
descriptionStr""The comment field of /etc/passwd.
homeOption<Str where matches(r"/.*")>none: /home/<name>, or /var/empty for system accounts.
create_homeOption<Bool>none: true for regular accounts, false for system accounts.
shellOption<Str where matches(r"/.*")>none: /usr/bin/bash, or /usr/bin/nologin for system accounts.
systemBoolfalseSystem accounts take their ids from the system range.
password_hashOption<Str where matches(r"!|\*|!?\$(y|gy|6|5|2b)\$.+")>A crypt(3) hash, or "!" to lock the account.
password_fileOption<Str where matches(r"/.*")>The absolute path of a file holding the hash, read at activation.
ssh_keysList<Str>[]OpenSSH public keys that may log in as the user.

Group ​

A group. Block label: the group name.

FieldTypeDefaultMeaning
gidOption<Int where 0..=65534>Allocated when none.
membersSet<Ref<User>>[]Members in addition to the users that list this group in groups.
systemBoolfalseSystem groups take their ids from the system range.

RundirOwner: Who creates and removes /run/user/<uid>. turnstile | elogind

Session ​

Login session tracking.

FieldTypeDefaultMeaning
rundirRundirOwnerturnstileWho creates and removes /run/user/<uid>.

Files and the kernel ​

File ​

A file in /etc. Block label: the absolute path. Exactly one content field is set when the file is enabled.

FieldTypeDefaultMeaning
textOption<Str>The content, verbatim.
sourceOption<Path>A file whose bytes are the content.
linkOption<Str where nonEmpty>A symlink with this target.
jsonOption<Data>A value rendered as JSON.
tomlOption<Data>A map rendered as TOML.
yamlOption<Data>A value rendered as YAML.
iniOption<Map<Str, Map<Str, Data>>>Sections of key=value lines, by section name.
envOption<Map<Str, Str>>KEY=value lines readable by POSIX shells.
modeInt where 0..=0o7770o644The permission bits.
ownerRef<User>rootThe owning user.
groupRef<Group>rootThe owning group.
copyBoolfalseCopy the file into /etc instead of linking it through /etc/static.
enableBooltruefalse removes the entry, including a package default or a derived file.

Kernel ​

Kernel modules to load, blacklist and configure.

FieldTypeDefaultMeaning
modulesList<Str where matches(r"[A-Za-z0-9_-]+")>[]Loaded during boot, after the root filesystem is mounted, in order.
blacklistSet<Str where matches(r"[A-Za-z0-9_-]+")>[]Never loaded automatically.
optionsMap<Str, Str>{}Module parameters, for example { snd_hda_intel = "power_save=1" }.

Packages, repositories and views ​

Channel: The channel of a repository a client follows. current | testing

Repo ​

A package repository. Block label: the repository name.

FieldTypeDefaultMeaning
urlStr where matches(r"(https|file|http)://.*")The primary base URL: https://, file://, or http:// with allow_http.
mirrorsList<Str>[]More base URLs serving the same content, tried in order after url.
keyStr where nonEmptyThe root public key: the base64 line of a minisign public key.
keysList<Str>[]More accepted root keys, used while a root key is replaced.
channelChannelcurrentThe channel to follow.
priorityInt0Higher wins when several repositories offer a package.
enableBooltrueWhether the repository is used.
allow_httpBoolfalsePermit http:// URLs.

Gc ​

Retention policy for generations and automatic collection.

FieldTypeDefaultMeaning
keep_generationsInt where 2..=100010Always keep at least this many newest generations.
keep_daysInt where 0..=365030Also keep every generation younger than this many days.
autoBooltrueRun gc after every successful apply.
keep_downloadsBoolfalseKeep downloaded package files after unpacking.

ViewBase: The only base a view can inherit from. inherit = none starts empty. system

View ​

A view besides the system view. Block label: the view name.

FieldTypeDefaultMeaning
inheritOption<ViewBase>systemsystem: start from the system's package requests. none: start empty.
packagesSet<Pkg>[]Package requests, replacing system requests of the same name.
alternativesMap<Str, Pkg>{}Group name to chosen member, overriding the system's choice.
usersSet<Str>[]Users allowed to enter the view, in addition to root.
groupsSet<Str>["wheel"]Members of these groups may enter the view.

Boot and storage ​

Loader: The boot loader. limine

Microcode: Which CPU microcode the initramfs carries. auto | intel | amd | both | off

Initrd ​

Settings for the initramfs.

FieldTypeDefaultMeaning
modulesSet<Str>[]Extra modules, by name.
hostonlyBooltrueDetect the needed modules from the machine running the assembly.
shellBooltrueInclude the emergency shell.
root_waitInt where 1..=60030Seconds to wait for boot devices.

Boot ​

Boot loader, kernel and boot counting.

FieldTypeDefaultMeaning
loaderLoaderlimineThe boot loader.
espStr"/boot"The mountpoint of the EFI system partition. It needs an fs entry of type vfat.
kernelPkglinuxThe package providing the kernel.
cmdlineList<Str>["quiet", "loglevel=3"]The kernel command line.
timeoutOption<Int where 0..=600>3The menu timeout in seconds. none waits forever.
editorBoolfalseAllow editing entries at the boot menu.
triesInt where 0..=103Boot attempts before falling back. 0 disables boot counting.
microcodeMicrocodeautoWhich CPU microcode the initramfs carries.
initrdInitrdInitrd {}Settings for the initramfs.

FsType: A filesystem type. other names one that is not listed. ext2 | ext3 | ext4 | xfs | btrfs | f2fs | vfat | tmpfs | nfs | nfs4 | other(name: Str where matches(r"[a-z0-9.]+"))

Fs ​

A mounted filesystem. Block label: the mountpoint.

FieldTypeDefaultMeaning
deviceOption<Str>noneRequired unless fstype is tmpfs.
fstypeFsTypeThe filesystem type.
optionsList<Str>[]Mount options. Empty means the defaults.
fsckOption<Bool>nonenone: true for ext2, ext3, ext4, f2fs and vfat, false otherwise.

Swap ​

A swap device. Block label: the device.

FieldTypeDefaultMeaning
priorityOption<Int where -1..=32767>noneThe swap priority.

LuksOption: An option of an unlocked LUKS device. discard | no-read-workqueue | no-write-workqueue

Luks ​

A LUKS device unlocked in the initramfs. Block label: the device-mapper name.

FieldTypeDefaultMeaning
deviceStrUUID=... or /dev/...
optionsSet<LuksOption>[]Options for the unlocked device.

Services ​

Init: The init system. Only runit is implemented. runit | s6 | dinit

ServiceKind: How a service is supervised. longrun | oneshot

Ready: When a service counts as ready. immediate | notify(fd: Int where 3..=1023) | check(cmd: List<Str> where nonEmpty, interval: Int where 1..=3600 = 1, timeout: Int where 1..=86400 = 60)

Log: Where the output of a service goes. logged | discard | console

Restart: Whether the supervisor restarts a longrun after it exits. always | on-failure | never

Signal: The signal that asks a service to stop. TERM | INT | HUP | QUIT | USR1 | USR2

OnChange: What live reconciliation does when only the spec of a service changed. restart | rerun | ignore | reboot

LogRotation ​

How a logged service's output is rotated.

FieldTypeDefaultMeaning
sizeInt where 4096..=1_073_741_8241_000_000Bytes per file before rotation.
countInt where 1..=100010Rotated files kept.

Dir ​

A directory the launcher creates before every start.

FieldTypeDefaultMeaning
pathStr where matches(r"[A-Za-z0-9._@+-]+(/[A-Za-z0-9._@+-]+)*")Relative to /var/lib for state_dirs, or to /run for runtime_dirs.
modeInt where 0..=0o77770o755The permission bits.
ownerOption<Ref<User>>nonenone: the service user.
groupOption<Ref<Group>>nonenone: the primary group of owner, or the service's group.

Limits ​

Resource limits, each applied as the soft and the hard limit.

FieldTypeDefaultMeaning
nofileOption<Int where 1..=1_073_741_816>noneOpen files.
nprocOption<Int where 1..=4_194_304>noneProcesses of the service user.
coreOption<Int where 0..=1_099_511_627_776>noneCore dump size in bytes. 0 disables core dumps.
memlockOption<Int where 0..=1_099_511_627_776>noneLocked memory in bytes.

Service ​

A system service. Block label: the service name.

FieldTypeDefaultMeaning
descriptionStr""A one-line description.
kindServiceKindlongrunHow the service is supervised.
enableBooltrueWhether the service is part of the generation.
execList<Str>[]Longrun: the command to supervise, as argv.
upList<Str>[]Oneshot: the command run on start, as argv.
downList<Str>[]Oneshot: the command run on stop, as argv.
userRef<User>rootThe account the service runs as.
groupOption<Ref<Group>>nonenone: the primary group of user.
groupsSet<Ref<Group>>[]Supplementary groups.
envMap<Str, Str>{}Environment variables.
cwdStr"/"The working directory.
umaskInt where 0..=0o7770o022The file mode creation mask.
afterList<Ref<Service>>[]Services that must be ready before this one starts.
readyReadyimmediateWhen the service counts as ready.
logLogloggedWhere its output goes.
rotateLogRotationLogRotation {}How its log is rotated.
state_dirsList<Dir>[]Directories under /var/lib to create before every start.
runtime_dirsList<Dir>[]Directories under /run to create before every start.
restartRestartalwaysThe restart policy of a longrun.
restart_delayInt where 0..=36001Seconds to wait before a restart.
stop_signalSignalTERMThe signal that asks the service to stop.
stop_timeoutInt where 1..=360010Seconds between the stop signal and SIGKILL.
limitsLimitsLimits {}Resource limits.
on_changeOption<OnChange>nonenone: restart for longruns, rerun for oneshots.
earlyBoolfalseMember of the early boot graph. Reserved for the base part.
packagesSet<Pkg>[]Packages added to the system view while the service is enabled.

Getty ​

The terminals that get a login prompt.

FieldTypeDefaultMeaning
ttysList<Str where matches(r"tty(S|USB)?[0-9]+")>["tty1", "tty2"]Terminal names. Each gets a service named getty-<tty>.

Security ​

Privileged ​

A file that keeps setuid, setgid or file capabilities in the active generation. Block label: the absolute path.

FieldTypeDefaultMeaning
enableBooltrueWhether the entry applies.
ownerRef<User>rootThe owning user.
groupRef<Group>rootThe owning group.
modeInt where 0..=0o77770o4755The mode, including setuid and setgid bits.
capsOption<Str>noneFile capabilities in cap_from_text(3) syntax, such as "cap_setuid=ep".

Security ​

Security settings.

FieldTypeDefaultMeaning
privilegedMap<Str, Privileged>{}Privileged files. Block label: the absolute path. Written as privileged blocks.

The base part ​

Every system includes a base part before its own file. It declares:

  • The static system accounts, with the same ids on every Laft system: root (0), the groups tty (5), disk (6), lp (7), kmem (9), wheel (10), cdrom (11), mail (12), dialout (18), floppy (19), audio (20), video (21), utmp (22), input (23), kvm (24), render (25), tape (26), sgx (27), shadow (41), plugdev (42) and users (100), the service accounts messagebus, sshd, dhcpcd, chrony, polkitd, rtkit, uuidd, dnsmasq, avahi, tss and log (30 to 40), and nobody with nogroup (65534).
  • The early boot services laft-activate, kernel-fs, kmod, udevd, udev-trigger, clock, hostname, mount-fs, swap, random-seed, sysctl, console and early, then turnstiled and boot-complete.
  • /etc/turnstile/turnstiled.conf, which follows session.rundir.
  • A tmpfs on /tmp.
  • The core repository, with a placeholder URL in the reserved .invalid domain until an official repository is published.
  • The privileged programs laft-enter, doas, passwd, fusermount3 and unix_chkpwd (setuid or setgid), and newuidmap and newgidmap (with file capabilities).
  • Kernel hardening sysctls, such as kernel.kptr_restrict = 1, kernel.yama.ptrace_scope = 1, fs.protected_symlinks = 1 and net.ipv4.conf.all.rp_filter = 2.

The std catalog ​

Configurations import catalog modules with import "std/services" as services and include their parts with include services.sshd().

PartWhat it adds
services.sshd(port = 22)The OpenSSH server with sshd-keygen, which creates missing host keys, and an sshd_config that allows public keys only and no root login.
services.dbus()The D-Bus system message bus.
services.seatd()The seat management daemon. Members of video may open a seat.
services.elogind()The elogind login manager, with D-Bus. It manages /run/user/<uid> instead of turnstile.
services.dhcpcd()The dhcpcd DHCP client for every interface.
services.iwd()The iwd wireless daemon, with D-Bus.
services.chronyd()The chrony time daemon, running as chrony.
services.nftables()Firewall rules loaded from /etc/nftables.conf on start and flushed on stop.
desktop.wayland(user, compositor = niri, terminal = foot, fonts = [])From std/desktop: a Wayland desktop for one user with a compositor (sway, niri or river), seatd, PipeWire, portals and fonts. The user joins video, audio and input.

The packages behind most of these parts have no recipes yet. See Status and roadmap.

Released under the MIT or Apache 2.0 license, at your option.