Portability (Linux distro-agnostic): - Remove hardcoded Clang compiler enforcement; GCC now builds - Add find_package(Threads REQUIRED) for older glibc - Add cmake install() target - FHS 3.0 default root: /kappa -> /usr/local/kappa - fs::path operator/ for all init/bootloader paths (fixes prefix fragility) - Multi-distro zoneinfo search (FHS, NixOS, Guix, alt) - Portable tar extraction (drop GNU-only --no-same-permissions) - Runit enable/disable commands now prefix-aware - --root CLI flag before/after subcommand, lazy directory creation - Shebang constants de-duplicated to types.hpp Correctness (race conditions, UB, corruption): - Fix CWD race in scheduler: per-child chdir() instead of process-global - Fix UB const_cast in exec_cmd/exec_capture: mutable argv buffers - Fix non-atomic installed DB writes: tmp+rename pattern - Fix read_file() no longer calls exit(1), throws instead - Fix silent catch(...) parse errors now print diagnostics - Fix rebuild false positives with config_hash change detection - Fix s6 disable_cmd copy-paste bug (was identical to enable) - Fix runit enable_cmd incomplete, disable_cmd wrong target - Fix dinit env vars: functional env-file + companion .env Quality: - Add -Wall -Wextra -Wpedantic to CMake, fix 2 pre-existing warnings - Move parse_int from error.hpp to parse_util.hpp - Fix hash verification guard checks all three hash types - Check patch return code in fetch.cpp - Add explicit system_dir creation in ensure_directories() - Add resolve to needs_dirs for build_registry() consistency - Update stale /kappa path references in examples - Remove inaccurate -Werror claim in CONTRIBUTING.md - Add build-gcc/ and agent dirs to .gitignore - Suppress clang-tidy portability-avoid-pragma-once - Fix .gitignore /kappa pattern (was matching include/kappa/) - Delete stale vcpkg_installed/ directory 54/54 tests pass. Builds on Clang and GCC with 0 warnings.
145 lines
3.5 KiB
Plaintext
145 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"
|
|
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"
|
|
}
|
|
}
|