- foo.kap: document all three env operators (=, ?=, +=) in header, demonstrate += in env block with comments - postgres.kap: demonstrate += for appending security hardening flags - config.kap: demonstrate system-level += for inherited flags
147 lines
3.5 KiB
Plaintext
147 lines
3.5 KiB
Plaintext
/*
|
|
* Kappa system configuration.
|
|
* Lives at /usr/local/kappa/system/config.kap
|
|
*
|
|
* INIT SYSTEM SELECTION
|
|
* =====================
|
|
* The `boot.init` field (line ~84) selects which init system manages this
|
|
* machine. Valid values (case-insensitive):
|
|
*
|
|
* systemd — system and service manager
|
|
* openrc — OpenRC dependency-based init
|
|
* s6 — s6 supervision suite
|
|
* dinit — dinit service manager / init system
|
|
*
|
|
* The `boot.bootloader` field (line ~122) selects which bootloader config
|
|
* kappa generates (grub or limine).
|
|
*
|
|
* This setting determines:
|
|
* 1. Which backend generates service files at install time
|
|
* (systemd → .service units, openrc → init.d scripts, etc.)
|
|
* 2. What `${enabledinit}` resolves to during package builds
|
|
*
|
|
* Package definitions do NOT specify per-init service blocks. A package
|
|
* defines its service once (see examples/foo.kap) and the selected init
|
|
* system's backend handles the translation.
|
|
*
|
|
* SERVICES BLOCK
|
|
* ==============
|
|
* The `services` section enables or disables services declared by
|
|
* installed packages. Each entry maps to a package's service name:
|
|
*
|
|
* services {
|
|
* nginx { enable = true } // package "nginx", default "main" service
|
|
* postgresql.main { enable = true } // package "postgresql", named service "main"
|
|
* postgresql.checkpointer { enable = false }
|
|
* }
|
|
*
|
|
* For single-service packages, the service name defaults to "main" and
|
|
* can be omitted. For multi-service packages, use dot-notation
|
|
* (pkgname.servicename) to target a specific named service.
|
|
*
|
|
* Additional keys in each service block (port, ssl, etc.) are passed as
|
|
* custom config to the service definition.
|
|
*/
|
|
|
|
imports = []
|
|
|
|
remotes = [
|
|
"https://packages.kappa-os.org/stable/",
|
|
"https://packages.kappa-os.org/contrib/",
|
|
]
|
|
|
|
assert {
|
|
"efi partition required for UEFI boot" : boot.efi != ""
|
|
"root partition must be set" : boot.root != ""
|
|
}
|
|
|
|
system {
|
|
hostname = "kappa.local"
|
|
timezone = "America/New_York"
|
|
|
|
features {
|
|
ssl = true
|
|
wayland = false
|
|
pulseaudio = false
|
|
}
|
|
|
|
env {
|
|
CFLAGS = "-O2 -march=native"
|
|
// packages inherit this appended flag
|
|
CFLAGS += "-pipe"
|
|
LDFLAGS = "-Wl,--as-needed"
|
|
MAKEFLAGS = "-j8"
|
|
}
|
|
|
|
config {
|
|
prefix = "/usr"
|
|
log_dir = "/var/log"
|
|
}
|
|
|
|
rollback {
|
|
keep = 5
|
|
}
|
|
}
|
|
|
|
packages {
|
|
foo {
|
|
version = ">=1.2"
|
|
features {
|
|
gui = true
|
|
}
|
|
config {
|
|
port = "9090"
|
|
ssl = true
|
|
}
|
|
}
|
|
bar {}
|
|
baz {
|
|
features {
|
|
ssl = false
|
|
}
|
|
}
|
|
|
|
/*
|
|
// Per-package overrides can also live in
|
|
// /usr/local/kappa/system/builds/<name>.kap
|
|
*/
|
|
}
|
|
|
|
services {
|
|
nginx {
|
|
enable = true
|
|
port = 80
|
|
ssl = true
|
|
}
|
|
sshd {
|
|
enable = true
|
|
port = 22
|
|
}
|
|
cron {
|
|
enable = false
|
|
}
|
|
}
|
|
|
|
// Select init system — determines which backend generates service files.
|
|
// Valid: systemd, openrc, s6, dinit (case-insensitive).
|
|
boot {
|
|
kernel = "linux"
|
|
init = "s6"
|
|
efi = "/dev/sda2"
|
|
swap = "/dev/sda3"
|
|
// Bootloader — generates the appropriate config at install time.
|
|
// Valid: grub, limine (case-insensitive).
|
|
bootloader = "limine"
|
|
root = "/dev/sda1"
|
|
}
|
|
|
|
users {
|
|
specter {
|
|
shell = "/bin/zsh"
|
|
groups = ["wheel", "audio", "docker"]
|
|
}
|
|
root {
|
|
shell = "/bin/zsh"
|
|
}
|
|
}
|