Align ISO bake and docs with bakery/Tauri product story

Derive BREAD_BINS from iso/bread-lockfile.toml and fail the bake when a
listed binary or breadhelp content is missing. Bake bakery share files
and drop breadcast from the copied installed.json. Add WebKitGTK 4.1 for
Tauri bos-settings, remove rustup, and rewrite README/DESIGN to match the
ISO+skel tree.
This commit is contained in:
Breadway 2026-08-15 21:40:55 +08:00
parent 881ac41cbb
commit a21e81476f
11 changed files with 427 additions and 212 deletions

163
DESIGN.md
View file

@ -1,4 +1,24 @@
# BOS — Bread Operating System Plan
# BOS — historical design plan
## Current architecture
**Read [README.md](README.md) for how this repo actually ships.** This file
is the original plan. Several sections below are historical and must not be
taken as current:
| Plan said | What the tree does now |
|-----------|------------------------|
| Cargo workspace with a `bos-settings/` member | This repo is ISO + Calamares + skel only. No Cargo workspace. |
| `bos-settings` as an in-tree GTK4 app | Standalone bakery product, **Tauri 2 + Svelte**. |
| bakery install in Calamares post-install | bakery binaries + breadhelp content are **baked into `/etc/skel` at ISO build time** from `iso/bread-lockfile.toml`. Missing bins fail the bake. |
| `dotfiles/` is the live skel | Live defaults are `iso/airootfs/etc/skel`. `dotfiles/` is stale. |
| A/B root swapping | **Future.** Today: btrfs + snapper + **grub-btrfs**. GRUB pins `rootflags=subvol=@`, so `snapper rollback` is not the user-facing recovery path. |
| Work on `dev`; origin = GitHub | Single-trunk `main`; `stable` is a CI marker. `origin` = Forgejo, `github` = GitHub. |
| `[breadway]` provides bakery/breadbar/bos-settings | `[breadway]` is breadlock + AUR republishes. Desktop apps are bakery. **Not shipped:** breadcast, breadarr. |
---
# Original plan (kept for history)
## Context
@ -7,51 +27,25 @@ The bread ecosystem (bread, breadbar, breadbox, breadcrumbs, breadpad/breadman,
Goals:
- **Install and be done**: Calamares GUI installer → reboot → working Hyprland + full bread stack
- **Rollback safety**: Btrfs subvolumes + snapper + snap-pac; every pacman transaction is snapshotted
- **Unified config**: `bos-settings` GTK4 app surfaces all app configs + snapshot management + bakery updates
- **Unified config**: `bos-settings` surfaces all app configs + snapshot management + bakery updates
- **Future-compatible**: Btrfs layout is designed to allow A/B partition migration later (SteamOS model)
---
## Repo Structure
Single new repo: `Breadway/bos` — a Cargo workspace.
Single new repo: `Breadway/bos`*planned as* a Cargo workspace. **That is
not what landed**; see Current architecture.
```
bos/
├── Cargo.toml # Workspace (members: [bos-settings])
├── bos-settings/ # GTK4 unified settings app
│ ├── Cargo.toml
│ └── src/
│ ├── main.rs
│ ├── state.rs
│ ├── theme.rs
│ ├── ui/
│ │ ├── window.rs # Sidebar + content shell (port breadman pattern)
│ │ ├── sidebar.rs
│ │ └── views/
│ │ ├── bread.rs
│ │ ├── breadbar.rs
│ │ ├── breadbox.rs
│ │ ├── breadcrumbs.rs
│ │ ├── breadpad.rs
│ │ ├── snapshots.rs
│ │ ├── packages.rs
│ │ └── hyprland.rs
│ └── config/
│ └── mod.rs # Per-app config loaders
├── iso/ # archiso profile
├── Cargo.toml # Workspace (members: [bos-settings]) — NOT in tree
├── bos-settings/ # planned GTK4 app — now its own bakery repo
├── iso/ # archiso profile (this is the repo)
│ ├── profiledef.sh
│ ├── packages.x86_64 # Live ISO + installed system package list
│ ├── airootfs/ # Files overlaid onto live ISO root
│ │ └── etc/
│ │ ├── calamares/ # Calamares YAML configuration
│ │ └── skel/ # Default user dotfiles
└── dotfiles/ # Default configs deployed at install time
├── hyprland/ # hyprland.conf, keybinds, autostart
├── bread/ # breadd.toml, init.lua, devices.lua
├── breadbar/ # (no config needed; zero-config by default)
├── breadbox/ # config.toml with default context priorities
└── breadcrumbs/ # breadcrumbs.toml with default home profile
│ ├── packages.x86_64
│ └── airootfs/
└── dotfiles/ # planned install-time configs — NOT the live skel
```
---
@ -70,7 +64,11 @@ bos/
Mount options: `noatime,compress=zstd,space_cache=v2` on all subvolumes.
**A/B compatibility note:** The `@` subvolume is self-contained and can be swapped atomically — this is the design property needed for a future A/B upgrade path. The layout does not need to change to adopt it.
**A/B compatibility note (future):** The `@` subvolume is self-contained and
could be swapped atomically. This is a design property for a later upgrade
path. It is **not** implemented. Recovery today is reboot into a grub-btrfs
snapshot; GRUB's `rootflags=subvol=@` means a raw `snapper rollback` is the
wrong instruction to give users.
### Snapshot tooling (installed + configured during post-install)
@ -96,100 +94,79 @@ No user-facing CLI needed for this component — `bos-settings` is the interface
### archiso profile (`iso/`)
- Derives from `/usr/share/archiso/configs/releng/` (the standard baseline)
- `packages.x86_64` includes: base, linux, grub, btrfs-progs, snapper, snap-pac, grub-btrfs, hyprland, pipewire, wireplumber, networkmanager, gtk4, gtk4-layer-shell, iw, librsvg, libpulse, bluez, bluez-utils, calamares, calamares-qt6
- `airootfs/etc/skel/` contains the default dotfiles (symlinked from `dotfiles/`)
- `packages.x86_64` is the live + installed pacman set (Hyprland, Calamares,
breadlock, WebKitGTK 4.1 for Tauri bos-settings, …). bakery apps are not
listed here.
- `airootfs/etc/skel/` contains the default user configs (this is the live
skel — not `dotfiles/`).
- Live session autologs into a `liveuser` and launches Calamares automatically
### Calamares modules (in order)
The historical list below included a post-install `bakery install` and
Calamares `bootloader`/`grubcfg` installing GRUB. What shipped instead:
binaries are already in skel; `post-install.sh` runs `grub-install` +
`grub-mkconfig` (Calamares' bootloader modules leave the ESP empty here).
1. **welcome** — system checks (RAM ≥ 2GB, internet, disk space)
2. **locale** — timezone + locale selection
3. **keyboard** — layout selection
4. **partition** — custom `btrfs` mode: creates EFI partition + single btrfs pool with the subvolume layout above
5. **users** — create main user, set password
6. **packages** — install package list (reuses `packages.x86_64`)
7. **bootloader** — install GRUB to EFI, `grub-mkconfig` with grub-btrfs hook
8. **shellprocess (post-install)** — runs `iso/post-install.sh`:
- Configures snapper root config
- Enables services: `NetworkManager`, `bluetooth`, `breadd` (user), `breadbox-sync` (user)
- Runs `bakery install bread breadbar breadbox breadcrumbs breadpad` (or `bakery install --all`)
- Copies `dotfiles/` into `/home/$USER/.config/` (skips any file that already exists)
7. **bootloader***planned*; actual GRUB install is in `post-install.sh`
8. **shellprocess (post-install)** — snapper, services, copy skel; does **not** run bakery
9. **finished** — reboot prompt
---
## Component 3: `bos-settings` GTK4 App
## Component 3: `bos-settings` (planned as GTK4)
### Tech choices (original)
### Tech choices
- **gtk4-rs** (v0.11, v4_12 feature), no relm4 — plain GTK4 following breadman's pattern
- **bread-theme** for palette + CSS (git dep: `github.com/Breadway/bread-ecosystem`)
- Reads/writes each tool's own config file directly (no unified intermediate config)
- Window: 960×640, sidebar 190px, `gtk4::Stack` for view switching — identical structure to breadman
**What shipped:** Tauri 2 + Svelte in its own repo
(`git.breadway.dev/Breadway/bos-settings`), distributed by bakery. This
repo does not build it.
### Sidebar sections + views
| Section | View | What it does |
|---------|------|--------------|
| **Apps** | bread | Edit `~/.config/bread/breadd.toml` |
| | breadbar | Edit `~/.config/breadbar/` (style.css override, no TOML needed) |
| | breadbox | Edit `~/.config/breadbox/config.toml` (context priority lists) |
| | breadcrumbs | Edit `~/.config/breadcrumbs/breadcrumbs.toml` (profiles, networks) |
| | breadpad | Edit `~/.config/breadpad/breadpad.toml` (model, reminders, calendar) |
| **System** | Snapshots | `snapper list` output; rollback button calls `snapper rollback N` |
| | Packages | `bakery list --installed`; update buttons call `bakery update <pkg>` |
| | Hyprland | "Open config in editor" + monitor list from `bread.state.monitors()` |
### Config loading pattern
Each view has a dedicated `load_config(path) -> Result<T>` and `save_config(path, T) -> Result<()>` using `toml` crate. Config structs mirror each app's existing types (no duplication — import the `*-shared` crate where it exists, e.g. `breadpad-shared`). For apps without a shared crate (breadbox, breadcrumbs), define minimal local structs.
### Snapshots view specifics
- On open: runs `snapper list --output-cols number,date,description,pre-post` via `std::process::Command`, parses into table rows
- Rollback: confirmation dialog → `snapper rollback <N>` → notify user to reboot
- Delete: `snapper delete <N>`
- No write access to `/` needed for list/rollback since snapper is configured with `ALLOW_USERS` for the main user
### Packages view specifics
- On open: reads `~/.local/state/bakery/installed.json` directly (no network)
- "Check for updates": runs `bakery list` (triggers index refresh), compares versions
- "Update all": runs `bakery update --all` in a subprocess, streams stdout to a log TextView
The panel list is still roughly accurate; see README. Snapshots recovery
should send users through **grub-btrfs reboot**, not `snapper rollback N`.
### Distribution
`bos-settings` gets a `bakery.toml` and is added to the `bread-ecosystem` registry — installable standalone on any Arch/Hyprland system via `bakery install bos-settings`, not only as part of a BOS install.
`bos-settings` has its own `bakery.toml` and is installable via
`bakery install bos-settings` on any Arch/Hyprland system, not only as part
of a BOS install.
---
## Component 4: Default Dotfiles
Minimal but functional defaults deployed at install time. These are opinionated starting points, not locked configs — users edit freely after install.
Minimal but functional defaults. These live in `iso/airootfs/etc/skel`
(`hyprland.lua` + JSON binds, not `dotfiles/hyprland/*.conf`).
| File | Key content |
|------|-------------|
| `dotfiles/hyprland/hyprland.conf` | Monitor auto-detect, default keybinds, `exec-once` for breadd/breadbar/breadbox-sync |
| `dotfiles/hyprland/keybinds.conf` | `$mod+Space` → breadbox, `$mod+N` → breadpad, `$mod+M` → breadman, `$mod+S` → bos-settings |
| `dotfiles/bread/breadd.toml` | All adapters enabled, log_level=info |
| `dotfiles/bread/init.lua` | Minimal: activates "default" profile on startup |
| `dotfiles/breadbox/config.toml` | Single default context with common apps |
| `dotfiles/breadcrumbs/breadcrumbs.toml` | Placeholder home profile (user fills in SSIDs) |
Zero-config bakery apps survive with no extra skel files. breadcrumbs
networks are user-filled after install — do not invent a full
`breadcrumbs.toml` in-tree.
---
## Build Order
1. **Dotfiles** — write default configs; these unblock installer testing immediately
2. **Btrfs + snapper config** — write `post-install.sh`; test in a VM with `archiso` livecdbase
3. **ISO profile** — archiso profiledef + package list + Calamares YAML; iterate in a VM
4. **bos-settings** — start with Snapshots and Packages views (highest value, no app-specific config parsing needed), then add per-app views one at a time
Historical. The ISO profile + skel + Calamares path is what this repo
iterates on. bos-settings is developed in its own repo.
---
## Verification
- **ISO**: Build with `mkarchiso -v -w /tmp/bos-work -o /tmp/bos-out iso/`; boot in QEMU (`qemu-system-x86_64 -cdrom bos.iso -m 4G -enable-kvm`); complete install; reboot into installed system; confirm all services running and bakery packages present
- **ISO**: `sudo ./build-local.sh` (not a raw `mkarchiso iso/` — the bake
step is required). Boot in QEMU; complete install; confirm bakery bins and
`~/.local/share/breadhelp/content`.
- **btrfs layout**: `btrfs subvolume list /` after install; confirm `@`, `@home`, `@snapshots`, `@log`, `@cache` exist
- **snapper**: `snapper list`; run `pacman -Syu` and confirm two new snapshots appear
- **grub-btrfs**: Reboot and confirm snapshot submenu in GRUB
- **bos-settings**: `cargo build --release`; launch; confirm each view loads its config file; edit a value, save, re-open and confirm persistence; test rollback button in Snapshots view
- **bos-settings**: built and tested in the bos-settings repo, not here