|
| 1 | +# MiOS — System Layer AI Entry Point |
| 2 | + |
| 3 | +> Agent loading order: this file → `/usr/share/mios/ai/system.md` (full prompt) → `/etc/mios/ai/system-prompt.md` (host override) → `~/.config/mios/system-prompt.md` (user overlay) |
| 4 | +
|
| 5 | +MiOS is an immutable bootc-native Fedora workstation OS delivered as an OCI image. The repo root (`mios.git`) **is** the system root `/` — no separate workspace. |
| 6 | + |
| 7 | +## What mios.git owns (build + system layer) |
| 8 | + |
| 9 | +| Path | Purpose | |
| 10 | +|---|---| |
| 11 | +| `/Containerfile` | OCI image definition (bootc, `FROM quay.io/fedora/fedora-bootc:42`) | |
| 12 | +| `/Justfile` | Build entry (`just build`, `just push`, `just clean`) | |
| 13 | +| `/automation/` | 48 shell scripts for system configuration | |
| 14 | +| `/usr/lib/systemd/` | 38 systemd units + 4 Quadlet container definitions | |
| 15 | +| `/usr/lib/dracut.conf.d/` + `/usr/lib/karg.d/` | 14 kernel argument files | |
| 16 | +| `/usr/share/mios/PACKAGES.md` | Package manifest (parsed by `automation/80-install-packages.sh`) | |
| 17 | +| `/usr/share/mios/profile.toml` | Vendor-default profile (lowest precedence) | |
| 18 | +| `/usr/share/mios/env.defaults` | Global `MIOS_*` env variable defaults | |
| 19 | + |
| 20 | +## Global env surface |
| 21 | + |
| 22 | +All `MIOS_*` variables resolve via five-layer cascade (highest wins): |
| 23 | + |
| 24 | +``` |
| 25 | +$MIOS_VAR env → ~/.config/mios/env → /etc/mios/install.env → /etc/mios/env.overrides → /usr/share/mios/env.defaults |
| 26 | +``` |
| 27 | + |
| 28 | +Key vars: `MIOS_AI_MODEL`, `MIOS_AI_EMBED_MODEL`, `MIOS_AI_BASE_URL`, `MIOS_BASE_IMAGE`, `MIOS_VERSION` |
| 29 | + |
| 30 | +## Build pipeline |
| 31 | + |
| 32 | +``` |
| 33 | +just build # Containerfile → OCI image |
| 34 | +just push # push to ghcr.io/mios-dev/mios:latest |
| 35 | +just clean # prune local image cache |
| 36 | +``` |
| 37 | + |
| 38 | +Local dev: `./mios-build-local.ps1` (Windows) · `./automation/build.sh` (Linux) |
| 39 | + |
| 40 | +## Merge-at-build semantics |
| 41 | + |
| 42 | +At `just build`, `mios-bootstrap.git` is fetched and merged onto this repo via `automation/00-bootstrap-merge.sh`. Bootstrap values (user profile, AI files, flatpak lists) override the vendor defaults in this repo. The merged result is baked into the OCI image. |
| 43 | + |
| 44 | +## Six Architectural Laws |
| 45 | + |
| 46 | +1. **USR-OVER-ETC** — defaults in `/usr/share/`; overrides in `/etc/`; never reverse |
| 47 | +2. **NO-MKDIR-IN-VAR** — runtime dirs declared in `tmpfiles.d`, not `mkdir` in scripts |
| 48 | +3. **BOUND-IMAGES** — all container images pinned; never `:latest` in Quadlets |
| 49 | +4. **BOOTC-CONTAINER-LINT** — `RUN bootc container lint` is always the final Containerfile instruction |
| 50 | +5. **UNIFIED-AI-REDIRECTS** — all `MIOS_AI_*` vars point to `http://localhost:8080/v1`; no vendor endpoints in committed files |
| 51 | +6. **UNPRIVILEGED-QUADLETS** — all Quadlet containers run rootless unless security policy demands root |
| 52 | + |
| 53 | +## Full agent context |
| 54 | + |
| 55 | +Load `/usr/share/mios/ai/system.md` for the complete prompt covering all 48 automation scripts, 38 systemd units, 4 Quadlets, 14 karg files, user creation, profile resolution, and day-2 operations. |
0 commit comments