Spec – omaflake: clean NixOS and macOS VMs at the push of a button

Status: draft v0.4 · 2026-10-16 · early development, not yet released

v0.3: tart is replaced entirely by an own runner on Virtualization.framework (DECISION, 2026-10-16). Guideline: every component must be publishable as open source (§11).

1. Goal

On a Mac with Apple Silicon (reference machine: MacBook Pro M1 Max, 64 GB) and on a Linux host with Nix or NixOS (x86_64 or aarch64, plan B124; checked on x86_64 with KVM, Ubuntu 26.04), create, start, reset and throw away a clean VM of a user-defined recipe at any time – via CLI and via an app, with one click. One app manages both guest kinds (macOS guests on a Mac only):

Guest kind Example recipes Content Runtime
NixOS (+ Hyprland) minimal, research, lab (dev later) NixOS modules own QEMU build (HVF, virgl) on a Mac; QEMU with KVM on Linux
macOS minimal, research, lab (office, dev later) nix-darwin modules on top of a manually prepared base own runner omaf-runner (Virtualization.framework)

The recipe names above are examples; users define their own recipes in their own flake (§11.1). VM content is as declarative as possible (Nix). Whatever cannot be declared for macOS goes once into the base and is documented in a checklist (§6.5). The app/CLI only takes care of operations.

2. Scope

In scope Out of scope
Linux guests: NixOS only, the host’s architecture (aarch64 on a Mac; x86_64 or aarch64 on a Linux host, plan B124) other Linux distributions, Omarchy, Windows, guests of another architecture than the host’s
macOS guests (Apple Silicon) via an own runner on Virtualization.framework tart, UTM, Lume or similar as runtime; Cirrus Labs images as foundation
QEMU with Apple Hypervisor (HVF) for NixOS; on a Linux host QEMU with KVM (TCG as a slow fallback) Virtualization.framework for Linux guests (no 3D)
Recipes as Nix modules (NixOS or nix-darwin) Ansible, Packer, MDM
macOS installation from Apple’s IPSW (restore image) registry/OCI images (pull/push)
Host: macOS on Apple silicon (NixOS and macOS guests); Linux on x86_64 or aarch64 (NixOS guests, plan B124); apps: SwiftUI on macOS, iced on Linux, omaf ui on both Windows host, macOS guests on a Linux host, web UI
Local use multi-user, server operation; distribution only with §11

3. Terms

  • Flake – Nix’s unit of distribution: a folder or repository with flake.nix/flake.lock (pinned inputs such as nixpkgs). omaflake’s image flake is nix/ (shipped in the app): it builds images from recipes and holds the guest modules, the omaflake agent and the Linux builder host – but no recipes (plan B107).
  • Recipe – what a VM is, one folder <author>/<kind>/<name>/: default.nix (a NixOS or nix-darwin module – the content), recipe.toml (metadata and runtime defaults) and its own files. Identity <author>/<kind>/<name>; as an ID <author>.<kind>.<name> (flake outputs, images, instances, current/ links). Users see the name with the guest kind; the CLI takes the name, <kind>/<name> or the full form and asks when several match.
  • Recipe source – where recipes come from (§11.3): omaflake/catalog on GitHub by default, other GitHub repositories (also private), an HTTPS folder with a catalog.json, or a local folder.
  • Base (macOS only) – VM freshly installed with omaf-runner from an Apple IPSW and prepared by hand (mac-base-<os-build>), built automatically by omaf macos install; background in docs/macos-base.md.
  • Runner (omaf-runner) – own Swift program that runs exactly one macOS VM via Virtualization.framework (window or headless) and can be controlled over a Unix socket; counterpart to the QEMU process.
  • Image (“Vorlage”) – immutable image built from a recipe at one revision – the baked and frozen cake; described by its image.json (recipe, author, kind, name, flake, revision, store path, time). A package ~/.omaflake/images/<id>-<rev>-<hash>.omaflake-image/ (§11.10): NixOS: disk.qcow2 (UEFI), copied out of the Nix store; macOS: the VM folder (RAW disk) that is never started.
  • Instance – a concrete VM: NixOS = thin qcow2 overlay on top of an image; macOS = APFS clone (clonefile) of the image folder with a new machine identifier and MAC address.
  • Ephemeral instance – instance whose changes are discarded on shutdown.
  • Backend – runtime per guest kind: QEMUBackend (NixOS), VZBackend (macOS, controls omaf-runner).
  • Guest user – login user inside the guest (for SSH): user = "…" in the recipe’s recipe.toml or omaf new --user; default is the Mac user name.

4. Architecture

catalogs (§11.3) → recipes/<author>/<platform>/<name>/recipe.toml + the modules/ and keymaps/ they use (downloaded or a local folder)
        │  staged into one folder → input omaflake-catalog of the image flake nix/ (+ the platforms, nixosModules.vm-guest)
        │
        ├── kind = nixos ─────────────────────────────┐
        │  nix build <image flake>#images.<recipe>     │  (omaflake's own Linux builder)
        │  → images/<recipe>-<rev>-<hash>.omaflake-image/disk.qcow2 (copied out of the store)
        │  omaf new → qemu-img create -b <relative path> … overlay
        │  omaf start → qemu-system-aarch64 -accel hvf … (virtio-gpu-gl, 9p, SSH forwarding)
        │
        └── kind = macos ─────────────────────────────┐
           omaf macos install → fetch IPSW from Apple → VZMacOSInstaller → mac-fresh-<os-build>
           → clone, provisioning, SSH keys, shutdown → mac-base-<os-build> (folder, immutable)
           omaf build <macOS recipe>:
             clonefile mac-base → omaf-runner headless → IP from DHCP leases
             → SSH: nix copy (closure built on the Mac) + darwin-rebuild activate
             → shut down → folder becomes images/<id>-<rev>-<hash>.omaflake-image/
           omaf new → clonefile image folder + new VZMacMachineIdentifier + new MAC
           omaf start → omaf-runner <instance> [--window] (own process, socket, VZVirtualMachineView)
        ▲
Rust core `omaflake-core` (crates/, one backend per guest kind) ── CLI `omaf` (linked)
        ▲  JSON-RPC 2.0 over stdio: `omaf serve` (docs/api.md)
macOS app (SwiftUI, OmaflakeKit's CoreClient), the Linux app (Rust, iced; plan B119), `omaf ui`

The logic lives in the Rust core; every UI is a client of omaf serve and holds only presentation (plan B117). omaf-runner stays Swift (Virtualization.framework) and is started by the core.

Principle: The image is immutable. “Reset” = discard the instance and create it anew. “Update” = rebuild the image and switch the instance to the new image. This applies to both guest kinds.

5. Data layout

Data folder: ~/.omaflake by default – deliberately not in Documents or Desktop (privacy-protected; omaflake asks for no access to them unless the user chooses a folder there). Movable in the app or with omaf config --home <dir>; the settings file always stays at ~/.omaflake/config.json and records the data folder (home).

~/.omaflake/
  images/<recipe-id>-<rev>-<hash>.omaflake-image/
                                   one package per image (§11.10) with image.json (what it is – never parsed from the
                                   name). NixOS: + disk.qcow2 (copied out of the Nix store, read-only, no GC root);
                                   macOS: the VM folder, read-only
  images/current/<recipe-id>       symlink to the current image per recipe (both guest kinds)
  bases/mac-fresh-<os-build>/      macOS: fresh installation from the IPSW, never started, read-only
  bases/mac-base-<os-build>/       macOS: base (automatic, `omaf macos install`), same layout, read-only
  ipsw/<os-build>.ipsw             downloaded restore images
  instances/<name>.omaflake-vm/    one package per VM (§11.10) – what makes up the VM, nothing that only lives while it runs
                                   (every JSON file omaflake writes names its JSON Schema in `$schema`, §5.1; older ones are migrated when read)
    instance.json                  recipe, kind, system, image, CPU/RAM, network, share, ephemeral, user, SSH port (NixOS)
    disk.qcow2, efivars.fd         NixOS only (overlay – its backing file a path relative to the package –, UEFI variables)
    vm/                            macOS only: clone of the image folder
    known_hosts                    the guest's SSH host key
    image.omaflake-image/          only in exported VMs and VMs that run from elsewhere: the image they need
  run/<name>/                      what only lives while a VM runs, outside its package: qemu.pid, qmp.sock, qga.sock,
                                   serial.log, qemu.log, .lock, agent socket and state; macOS: runner.sock, runner.pid,
                                   runner.log (omaf-runner; SSH on the NAT address, port 22); lan<i>.sock (a macOS
                                   VM's cards on networks between VMs, §11.12)
  run/net/<network>/               a network's switch while it runs: qemu.sock, vz.sock, switch.pid, switch.log,
                                   status.json (§11.12)
  networks.json                    the networks between VMs and their members (§11.12)
  recipes/                         downloaded and imported recipes (§11.3), `.installed.json`
  share/<name>/                    default folder of a volume (§11.13): NixOS guests 9p, macOS guests virtiofs
  volumes.json                     the volumes the user made, with a folder of the user's where chosen (§11.13)
  qemu/<tag>/, qemu/current        own QEMU build (qemu/build.sh, relocatable)
  logs/                            image builds, first boot of a base
  cache/                           Dock icon for QEMU, askpass helper (no secrets)
  config.json                      settings (only in ~/.omaflake, even if the data folder is elsewhere)
  developer/                       contributors' own local files (e.g. tokens for their tooling) – never read,
                                   moved or cleaned up by omaflake
  _to_delete/                      only from older versions and development (omaflake itself deletes, see 9.)

macOS VM folder (own format, modeled on Apple's sample code):
  config.json        CPU, RAM, display, MAC address, format version
  hardware-model     VZMacHardwareModel.dataRepresentation
  machine-id         VZMacMachineIdentifier.dataRepresentation (new per instance)
  aux.img            VZMacAuxiliaryStorage
  disk.img           system disk, RAW, sparse (VZDiskImageStorageDeviceAttachment supports RAW only, plan BM9)

5.1 File versions (plan B114)

Every JSON file omaflake writes starts with "$schema": "https://omaflake.dev/schema/<type>/v<n>.json" – what the file is and its version, one count per type. The JSON Schemas are in docs/schema/ and published on omaflake.dev (GitHub Pages from docs/); a published version is never removed. omaflake brings an older file up to date when it reads it (step by step, v → v<n+1>, and writes it back) and refuses a newer one or another type. A file without `$schema` is version 0 (before B114).

Compatibility. Each omaflake reads every version of a type from a minimum on, and writes the newest. A new feature that changes a file gets a new version; older versions stay readable. The goal from the stable release 1.0.0 on: a minimum is raised only with a major release (2.0.0, …) – exceptions are possible but rare. Before 1.0.0 a minor release may still raise it (and says so in the changelog). A file below the minimum or newer than this omaflake is not read: the app and the CLI list it with a warning (VMs, images, recipes) instead of leaving it out silently.

Type File Minimum (0.2.0)
image image.json in an image package 0
instance instance.json in a VM package 0
settings ~/.omaflake/config.json 0
installed <data>/recipes/.installed.json 0
macos-vm config.json of a macOS VM folder (base, image, VM) 0
manifest manifest.json of an exported package 0
catalog a source’s catalog.json ($schema from v2; v1 had "schema": 1) 1
recipe recipe.toml as "$schema" = "…/recipe/v1.json" (TOML; editors with Taplo can use it) 0

Catalogs and recipes come from their sources and are never migrated by omaflake – a newer version always comes from its author. An older one within the minimum is read as it is (version 0/1: no systems, so the architectures of Apple silicon). After Refresh in the Recipes tab, newer versions of downloaded recipes are listed and can be taken over, or added next to the older one when older recipe versions are kept (plan B111).

6. Components

6.1 Image flake and recipes (Nix)

The image flake nix/ (this repo, shipped in the app – nix/README.md):

  • modules/vm-guest.nix (root flake output nixosModules.vm-guest) – guest hardware (UEFI, virtio, labels nixos/ESP, 9p share, option vm.shareFolder.enable) and the omaflake agent (§11.9)
  • the NixOS platform: modules/base.nix (guest user, locale and keyboards, SSH with your public keys, Nix settings), modules/platform.nix (the options modules share, the host name), home/ (the user’s home-manager: git’s identity); modules/look.nix + looks/ – the look (plan B135, B141): the installed look chosen at the build, one file per program under /etc/omaflake/look/ and its parts for modules, NixOS and macOS guests
  • the macOS platform: modules/darwin-guest.nix (guest user as system.primaryUser, Nix, SSH, widgets off), modules/darwin-platform.nix (files written once into the home folder, the host name)
  • inputs omaflake-guest (who you are, where the guest lives, its look) and omaflake-catalog (the recipes of the sources with their modules and key bindings, staged by omaflake); outputs images.<system>.<id>, nixosConfigurations.vm-<system>-<id>, darwinConfigurations.<id>, lib.recipeDefaults

The recipes (omaflake/catalog and other sources, §11.3, plan B142) are data: a platform, modules (Nix, each with module.toml: version, capabilities it provides and needs, the modules it enhances, actions with default keys), a suggested look, key binding sets, what a VM needs at least ([requirements]) and how it runs ([vm]), and which locales it is made for. The image flake imports the recipe’s modules and gives each its keys (module.toml’s defaults, the recipe’s sets over them). Every key omaflake binds in a guest starts with Cmd/SUPER or Ctrl, optionally with Shift; plain keys only inside a mode; an editor’s own keys stay as they are.

A module may need files nobody may pass on (module/v3, plan B198: Xcode): its Nix asks for a fixed-output path (requireFile, a name and a hash), its module.toml ([[files]]) says the names the file comes as and where to look. omaflake knows from the name and the hash whether the path is in the Nix Store; before a build it adds a file found in those places (a .xip or .zip unpacked), checked to land at that path. Missing everywhere, the build is refused with what to do, and the build page asks for the file (“Choose …”: a download, a folder or an app; omaf files add).

A module may ask for values (module/v4, plan B206: a runner’s URL and registration token, a seed, a background). Its [[fields]] each have a type – text, secret, file, choice, number, switch – and a when: build values are built into the image (the module reads them as omaflake.fields in its Nix) and are part of the image’s identity – a secret never is one, and a build file is the module/v3 file nobody may pass on (a name and a hash); create values are asked when the VM is created (the New VM form shows each module’s fields at its end; omaf new --set) and handed to it at its first start; always values too, and they can change later (“Settings …” on the VM, vms.settings, omaf settings) – handed over at once while the VM runs, else at its next start. Create and always values go to the module’s [setup] command in the guest: <command> --omaflake-setup over SSH with one JSON object on standard input, each value in its type, a file copied into the guest first and given as its path there. They belong to the VM – never to the recipe, the image or the Nix Store: plain values in its setup.json, secrets in the Keychain or the Secret Service until the command took them (longer with keep); removing the VM deletes them. While a required value is missing the VM’s row says so.

6.2 Core library + CLI omaf

Rust workspace (repo root, Cargo.toml; every crate on crates.io with omaflake’s version, plan B192): omaflake-core (logic), omaflake (the program omaf: the CLI and, with omaf serve, the JSON-RPC interface every UI uses – docs/api.md), omaflake-sdk (the client, the API’s types, page models, texts, design tokens), omaflake-tui (omaf ui), omaflake-gui (the Linux app), omaflake-i18n, omaflake-macros; the guest agent nix/agent is omaflake-agent. Swift package (Package.swift): OmaflakeKit (the client of omaf serve with the API’s types, the agent protocol and macOS VM bundle for the runner, the brand images), omaf-runner (runner for macOS guests), app omaflake. External tools as child processes: nix, qemu-img, qemu-system-aarch64, ssh. No dependency on tart.

Command Effect
omaf recipes recipes (their recipe.toml, with kind) + image status
omaf macos install [--ipsw <file>] base from Apple’s IPSW (default: latest supported), ready to build images from
omaf build <recipe> NixOS: nix build .#images.<system>.<recipe>, the qcow2 copied into the image package, symlink. macOS: image pipeline §6.5
omaf export vm\|image\|recipe … / omaf import <package> / omaf external add <package> packages to and from an external disk, a NAS or a folder; a VM run from where it is (§11.10)
omaf new <name> --recipe <f> [--ephemeral] [--user <u>] instance folder + overlay (NixOS) or APFS clone with new machine identifier (macOS)
omaf start <name> start backend (window or headless); state can be reconstructed from files
omaf stop <name> NixOS: QMP system_powerdown; macOS: requestStop() via the runner socket (with timeout); then hard stop
omaf reset <name> delete the instance state, recreate it from the image
omaf upgrade <name> switch instance to the current image of its recipe (old state deleted)
omaf rm <name> delete the instance (the folders of its volumes stay)
omaf list instances of both guest kinds with status, recipe, image revision
omaf ssh <name> NixOS: ssh -p <port> <user>@127.0.0.1; macOS: ssh <user>@<IP from /var/db/dhcpd_leases>
omaf wait/log/images/config/doctor readiness, console, images (list, delete), settings, prerequisites (details: docs/cli.md)

Backend protocol (plan §3, §7.3): start, stop, status, create, reset, remove, ssh. kind in instance.json selects the backend.

6.3 QEMU invocation (NixOS, reference)

qemu-system-aarch64 \
  -machine virt,highmem=on -accel hvf -cpu host \
  -smp $CPUS -m ${MEM}G \
  -drive if=pflash,format=raw,readonly=on,file=$QEMU_SHARE/edk2-aarch64-code.fd \
  -drive if=pflash,format=raw,file=$INST/efivars.fd \
  -drive if=virtio,format=qcow2,file=$INST/disk.qcow2 \
  -device virtio-gpu-gl-pci -display cocoa,gl=es \
  -device qemu-xhci -device usb-kbd -device usb-tablet \
  -netdev user,id=n0,hostfwd=tcp:127.0.0.1:$SSH_PORT-:22 -device virtio-net-pci,netdev=n0 \
  -fsdev local,id=fs0,path=$VOLUME,security_model=mapped-xattr \
  -device virtio-9p-pci,fsdev=fs0,mount_tag=$NAME \    # once per volume (§11.13)
  -qmp unix:$INST/qmp.sock,server=on,wait=off \
  -serial file:$INST/serial.log
# ephemeral: additionally -snapshot

Minimal boot probe with these arguments: scripts/bootprobe.sh.

Several displays (plan B171; instance.json displays, 1 to 4, NixOS only – Virtualization.framework gives a macOS guest one display): the GPU gets max_outputs=<n> in window starts (headless keeps one output), so the guest sees n monitors. omaflake’s Cocoa (patch qemu-cocoa-displays, patchset 7) opens a window per further output, on the screen of its number when there is one; a shown window connects its output at its size (suggested right of the ones before it), closing it disconnects the output, View → its console brings it back. The one USB tablet takes positions on the guest’s desktop of all outputs side by side, in output order – the guests’ default layout (a guest arranging its monitors otherwise: OPEN). GTK (Linux hosts) shows the outputs as tabs (show-tabs=on), each can be detached into a window.

On a Linux host (plan B124, qemu_command::Target) the same list with the host’s machine, accelerator, window and sound – everything else (disk, network, share, agent ports, QMP, serial log, pid file) is word for word the same:

  x86_64 host aarch64 host
binary qemu-system-x86_64 qemu-system-aarch64
-machine q35 (plus -vga none) virt,highmem=on,gic-version=host (KVM) / gic-version=max (TCG)
-accel / -cpu kvm / host when /dev/kvm opens read-write, else tcg / max same
firmware edk2-x86_64-code.fd; the VM’s efivars.fd is a copy of edk2-i386-vars.fd edk2-aarch64-code.fd, blank 64 MiB store
window (2D / 3D) virtio-vga / virtio-vga-gl, -display gtk[,gl=on],zoom-to-fit=on (,show-tabs=on with several displays) virtio-gpu-pci / virtio-gpu-gl-pci, GTK
sound -audiodev pipewire (socket $XDG_RUNTIME_DIR/pipewire-0), else pa, else no sound device same
share security_model=mapped-xattr (the guest-owner patch is the Mac build’s) same

Firmware: next to the binary (<prefix>/share/qemu/, as nixpkgs’ qemu ships it), else QEMU’s firmware descriptors (/etc/qemu/firmware, /usr/share/qemu/firmware; UEFI, split flash, no Secure Boot/SMM). The accelerator a VM was started with is kept in its run folder (accel) and shown with the VM. No omaf-runner bridge on Linux (agent report, clipboard, camera – OPEN), so readiness is SSH there. Verified with -accel help, -machine help, -device help, -display help, -audiodev help of nixpkgs’ QEMU 11.1.2 (aarch64-linux).

Network modes from recipe.toml:

Mode NixOS (QEMU) macOS (omaf-runner)
shared -netdev user with SSH forwarding VZNATNetworkDeviceAttachment (192.168.64.x)
isolated -netdev user,restrict=on + SSH forwarding not available (M10, plan BM27): NAT has no outbound block; a vmnet host-mode network needs a restricted entitlement – omaf new/start refuse it. Later: packet filter or VZFileHandleNetworkDeviceAttachment (OPEN; networks between VMs are a second card, §11.12)
none no network card no network card (SSH not possible then)

6.4 Runner omaf-runner (macOS, to be verified in M7)

One process per running macOS VM (a VZVirtualMachine lives only as long as its process). Started like QEMU via posix_spawn + setsid, so that app and CLI do not take it down with them.

Building block Virtualization.framework
Platform VZMacPlatformConfiguration (hardwareModel, machineIdentifier, auxiliaryStorage)
Disk VZVirtioBlockDeviceConfiguration + VZDiskImageStorageDeviceAttachment (RAW)
Graphics, input VZMacGraphicsDeviceConfiguration, VZMacKeyboardConfiguration, pointing device; window with VZVirtualMachineView
Network VZVirtioNetworkDeviceConfiguration + VZNATNetworkDeviceAttachment, fixed MAC per instance
Volumes one VZVirtioFileSystemDeviceConfiguration + VZSingleDirectoryShare per volume, tag = its name; mounted by the guest’s omaflake-volumes daemon at /Volumes/<name> (§11.13)
Installation VZMacOSRestoreImage (local or latestSupported) + VZMacOSInstaller
Control Unix socket runner.sock: status, stop (requestStop()), kill (stop()), show (bring window to front)
Signing entitlement com.apple.security.virtualization (required per SDK header, plan BM8)
omaf-runner run   <vm-dir> [--window] --socket <instance>/runner.sock   # blocks until the VM is off
omaf-runner install <vm-dir> --ipsw <file> --disk-gb 80                 # fresh macOS installation

6.5 macOS image pipeline

  1. Installation (automatic, omaf macos install): download IPSW from Apple or use an existing file, install into a new VM folder with VZMacOSInstaller.
  2. Base (automatic, once per macOS version, plan BM29): clone of the fresh installation, first boot headless with provisioning (guest user, automatic login, SSH), the Mac user’s SSH public keys into authorized_keys, shutdown, read-only → bases/mac-base-<os-build>/. No Apple ID, no license sign-ins. omaflake distributes no macOS images: the IPSW always comes from Apple and the base is built on the user’s Mac (whether Apple’s license would allow distributing a prepared base: OPEN, not pursued).
  3. Image (automatic, omaf build): clone the base, start headless, install Nix via SSH (only if not already in the base), build the closure of darwinConfigurations.<id> on the Mac and transfer it with nix copy, activate in the guest, shut down, store as image.
  4. Optional finishing (manual, per recipe): permissions (TCC) for installed apps that can only be granted by hand.
  5. Instances: APFS clones; Apple ID, Microsoft 365 sign-in etc. per instance.

6.6 Menu bar app (SwiftUI, MenuBarExtra)

Planned (plan B119): a setting “Show omaflake in: menu bar / window / both” – the same pages in a regular app window with a Dock icon. Linux gets its own app (Rust, iced) in the same brand look: a window, a tray icon over StatusNotifierItem and a waybar module, all coming with omaflake. Planned (plan B121): the core also says what each page shows (a presentation model); SwiftUI, iced and a terminal interface (omaf ui, ratatui, macOS and Linux) only draw it.

  • List of instances of both guest kinds with status dot and guest-kind icon; click = start or bring window to front
  • “New VM…” (recipes grouped by guest kind, name, ephemeral yes/no), “Reset”, “Stop”, “Rebuild image” (with log view)
  • Limit of 2 running macOS VMs: check before starting and show clearly (instead of passing the error through)
  • omaflake icon everywhere: menu bar (template image), app bundle (omaflake.icns), Dock icon of omaf-runner and of QEMU windows (plan B27)
  • Signing: locally ad-hoc; entitlements only as needed (QEMU and omaf-runner run as separate processes; only omaf-runner needs com.apple.security.virtualization)

7. Milestones & acceptance criteria

# Content Done when …
M0 Repo foundation ✅ 2026-10-16: Git repo, flake.lock committed, nix flake check green
M1 Image build nix build .#images.dev produces a UEFI qcow2 that boots with the QEMU reference invocation (headless, scripts/bootprobe.sh); labels match vm-guest.nix. UTM boot dropped (option A). ✅ 2026-10-16 (minimal and dev)
M2 QEMU with graphics acceleration QEMU on the Mac starts an image with virtio-gpu-gl-pci; Hyprland runs smoothly. ✅ 2026-10-16: own build (qemu/), dev with virgl/ANGLE, confirmed smooth by the maintainer
M3 CLI MVP omaf build/new/start/stop/reset/rm/list/ssh work; ephemeral instance is clean after restart. ✅ 2026-10-16 (full cycle on image minimal, plan §4)
M4 App Menu bar app can do everything from M3 by click. ✅ 2026-10-16 (app omaflake, accepted by click)
M5 Graphics backend production-ready plan §4
M6 Comfort (NixOS) clipboard Mac↔VM, dynamic resolution, optional camera bridge
M7 Runner omaf-runner omaf-runner install installs macOS from an IPSW into a new VM folder; omaf-runner run starts it with window and headless; control via socket (status/stop); ad-hoc signed with com.apple.security.virtualization. ✅ 2026-10-16 except headless stop (confirmation dialog in the guest, plan BM17 → SSH shutdown in M9/M10)
M8 macOS base bases/mac-base-<os-build>/ created per docs/macos-base.md; reachable via SSH with key as the guest user; checklist fully ticked. ✅ 2026-10-16 (development base mac-base-26A434, plan §7)
M9 macOS image by script the build script for mac-minimal produces images/mac-minimal-<rev>/ without manual intervention; a clone shows Dock, apps, defaults and wallpaper as declared; then mac-office, mac-dev. ✅ 2026-10-16 for mac-minimal (BM18–BM26); mac-office, mac-dev open
M10 VZBackend in OmaflakeCore + CLI omaf macos install, omaf build/new/start/stop/reset/rm/list/ssh for mac-minimal; ephemeral instance demonstrably clean; omaf list shows both guest kinds. ✅ 2026-10-16 for new/start/stop/reset/rm/list/ssh incl. ephemeral and the 2-VM limit (plan §7); omaf macos install and omaf build for macOS ✅ 2026-10-16 (plan BM28)
M11 App for both guest kinds app can do everything from M10 by click; limit of 2 macOS VMs is shown before starting
M12 Recipe interface recipes are read only via the defined flake outputs (§11.1); no user-specific paths/names in the Swift code

8. Open items (OPEN – clarify before implementation)

Review 2026-10-16 (details, evidence and revised milestones: plan §1.2, §4, §7): NixOS track M0–M4 done. macOS: nix-darwin options for Dock/apps checked (BM1); tart replaced, Virtualization.framework API checked against the macOS 27 SDK (BM8–BM10).

  • Linux builder: a Linux builder is required to build NixOS images on the Mac – omaflake’s own (as the user) or nix-darwin’s; see docs/linux-builder.md.
  • M2 QEMU build: DECIDED 2026-10-16 – own build with virglrenderer + ANGLE (plan B6). Template github.com/omacom/try-omarchy (MIT license, observe its license notices).
  • UEFI firmware: located per QEMU at <prefix>/share/qemu/edk2-aarch64-code.fd; the CLI derives the path from the binary.
  • Clipboard (NixOS): spice-vdagent is X11-oriented; under Hyprland possibly an own solution is needed (template: try-omarchy).
  • Camera bridge: DECIDED (2026-10-17) for NixOS – as try-omarchy: AVFoundation on the Mac → virtio-serial → v4l2loopback in the guest, on demand (plan B37). macOS guests: the same Mac side (plan B49), over the agent from 0.7.5 on (plan B169); in the guest OBS’s virtual camera reads the agent’s stream until omaflake’s own CoreMediaIO camera extension (M12).
  • Image retention: How many old image revisions are kept? (both guest kinds)
  • macOS – wallpaper: no nix-darwin option (BM1) → script (desktoppr or osascript) in the GUI session (LaunchAgent). Which approach works on macOS 27: OPEN (M8).
  • macOS – widgets: DECIDED (2026-10-16): off in all macOS VMs – widgets are used on the host. Implemented in the darwin guest module: system.defaults.WindowManager.StandardHideWidgets = true and StageManagerHideWidgets = true (M8). Content/arrangement is not declarable (WidgetCenter can only query/reload its own widgets, plan BM1) and is therefore dropped.
  • macOS – ad-hoc signature: sufficient locally (plan BM12).
  • macOS – clipboard: VZSpiceAgentPortAttachment.sharesClipboard exists, but needs a SPICE agent in the guest; for macOS guests an own small agent (e.g. over virtio-vsock) is needed: OPEN (after M11).
  • macOS – ephemeral: DECIDED (M10, plan BM27): fresh APFS clone at every start, the previous run’s clone is deleted. Only changed blocks take space.
  • macOS – limit of 2 VMs: resolved – the framework enforces it, error VZErrorDomain 6 (plan BM16).
  • macOS – shutdown: requestStop() triggers a confirmation dialog when a user is logged in (plan BM17) → omaf stop: SSH sudo -n /sbin/shutdown -h now → runner stop (without network) → runner kill → SIGKILL (implemented in M10).
  • macOS – IP address: from /var/db/dhcpd_leases via the MAC – verified (M7).
  • macOS – credentials: own installation → the guest user is created at first boot by provisioning (no Setup Assistant); SSH key-only: DECISION in M8.
  • macOS – Cirrus Labs image gg-vanilla: only for experiments; not the foundation of the base (license/provenance unclear, §11).

9. Rules & constraints

  • Deleting (DECIDED 2026-10-17): what the user removes – instances, their old state on reset/upgrade, images, failed builds – omaflake deletes for real (the app asks first and says it cannot be undone); share folders are never deleted. “Never delete, move to _to_delete/” is a rule for developers’ and agents’ own actions (CLAUDE.md).
  • Verify before claiming: check Nix options, QEMU parameters and Virtualization.framework API against source/SDK headers; mark anything unverified as OPEN.
  • Open-source ready: no dependency that cannot be published as open source or obtained freely by the user (§11.2).
  • No credentials in the repo. Initial password changeme (NixOS) only until first login.
  • macOS license: at most 2 concurrently running macOS VMs per Mac.
  • No Apple ID and no license sign-ins in base or images – only in instances.

10. Risks

Risk Mitigation
QEMU build with graphics on macOS is laborious clarify early in M2; fallback UTM
nixpkgs-unstable breaks options commit flake.lock, update deliberately
Disk usage from images overlays/APFS clones instead of copies; retention rule (OPEN)
Hyprland unstable with virgl blur/shadows off; fallback lighter compositor
macOS update makes the base unusable rebuild the base per macOS version with omaf macos install; rebuild images from it
Base drifts / is not reproducible built by omaf macos install only (BM29); nothing is done by hand
Own runner is extra work (installation, network, window) Apple’s sample code as template; Lume (trycua) only after license check (OPEN); do not adopt tart code (FSL)
Virtualization.framework changes with macOS versions check availability with @available; define a minimum version (plan §5)

11. Open-source release

Goal: others define their own recipes in their own flake; the app remains a pure macOS app for NixOS and macOS guests. Order: first finish the core feature set (M11), then the interface (M12), then release.

11.1 Recipe interface (DECIDED 2026-10-18, plan B105/B107)

A recipe is data, put together from building blocks (plan B141, B142): recipes/<author>/<platform>/<name>/recipe.toml ("$schema" recipe/v2, format: omaflake/catalog, CONTRIBUTING.md) names its platform (nixos | macos), the architectures it is built for (systems), its modules and key binding sets by <author>/<name> – the newest, an exact version, or a minimum and/or maximum –, a suggested look, [requirements], [vm] and [locales]. Modules are the Nix (modules/<author>/<platform>/<name>/), reviewed in their catalog; capabilities (capabilities.toml: desktop, terminal, multiplexer, shell, editor, default-editor, pdf-viewer) say what a module needs and what is exclusive – warnings, never refusals. catalog.json (v4) lists a source’s recipes, modules, key binding sets and looks. omaflake builds them with its own image flake (nix/, shipped in the app), which takes them as its input omaflake-catalog and gives

images.<system>."<author>.<kind>.<name>@<words>"       # kind nixos: the UEFI qcow2 (aarch64-linux, x86_64-linux)
darwinConfigurations."<author>.<kind>.<name>@<words>"  # kind macos: activated on a clone of the base
lib.recipeDefaults."<author>.<kind>.<name>@<words>"    # each recipe.toml plus author, kind, name

(Staged by omaflake with recipes.json, §11.11 – one tree per recipe with the modules and key bindings it uses; a catalog checkout for nix flake check gives the IDs without @<words>.)

Another image flake (omaf config --flake …) works if it has the same inputs (omaflake-guest, omaflake-catalog) and outputs.

Person-specific values never live in a recipe (DECIDED and implemented 2026-10-17). User, full name, e-mail, time zone, locale, keyboard, SSH public keys and the macOS guest user come from omaflake: the image flake declares the input omaflake-guest (a folder with settings.json, flake = false, neutral defaults in the repository); omaflake replaces it on every nix call with <data folder>/guest (--override-input … --no-write-lock-file, so the lock file keeps only the relative default). Sources: the Mac (user, full name, time zone, locale, keyboard from the HIToolbox preferences, ~/.ssh/*.pub), the macOS base (its guest user – images always match their base), and the overrides in the app’s settings / omaf config --guest-…. Since plan B137 user, full name and e-mail are a credential’s: an image is built from a recipe with a credential and a look (else the recipe’s), both chosen at the build and recorded in image.json; the settings hold only the defaults. Since plan B139 there is no image without a credential (the Doctor requires one, the default), the host’s user only prefills the first credential, and a macOS base is created from a credential and records it (omaflake-base.json): macOS images take its user and stored password – no password is ever typed after the credential’s creation. A developer’s local/settings.nix still overrides single values on top; the Doctor flags a macOS user that then differs from the base’s. Flakes without the input keep working (nothing is passed). With preset recipes (§11.3) a user therefore needs no settings file at all; later generic images move the same values to the first start of an instance.

11.2 What the user brings (DECIDED 2026-10-16)

omaflake ships only itself (app, omaf, omaf-runner). The user’s Mac brings:

Prerequisite Why Without it
Apple silicon, macOS 27 Virtualization.framework, guest provisioning for the automatic macOS base (BM11) –
Nix with flakes recipes are evaluated and all images are built with Nix nothing can be built
A Linux builder (omaflake’s own since plan B160, or nix-darwin’s nix.linux-builder) builds NixOS images; required so that every feature works –
QEMU (NixOS guests) runtime of NixOS guests; 3D needs omaflake’s patched build Homebrew/nixpkgs QEMU: headless and 2D only
SSH key in ~/.ssh omaf ssh, image builds, base provisioning –

QEMU is not shipped in the app (DECIDED): omaflake’s patched build (virglrenderer + ANGLE, qemu/) is a Nix package of the omaflake flake (packages.aarch64-darwin.qemu, qemu/package.nix), installable with one command or one line in the nix-darwin configuration; a binary cache so nobody compiles it: OPEN. Implemented: Prerequisites (OmaflakeCore), omaf doctor, the app’s Requirements page. The app moderates all prerequisites on one page: detect existing installations (configured path, PATH, Nix profile, nix-darwin system, Homebrew), show what they can do (e.g. 3D), let the user enter a path by hand, and offer “Install” – it opens Terminal with the official command, so the user sees what runs and enters the admin password there. Superseded for admin tasks by §11.5 (2026-10-17): the app may run them itself through macOS’ administrator dialog.

11.3 Recipe sources, presets, marketplace (DECIDED and implemented 2026-10-18, plan B107)

omaflake ships no recipes. It reads them from recipe sources:

  • Kinds: a GitHub repository (https://github.com/owner/repo, owner/repo, …/tree/<branch>; default branch main), the HTTPS URL of a catalog.json (any static host), or a local folder (a checkout with recipes/<author>/<kind>/<name>/, or a folder of such folders). Kept in config.json (sources, in order); none set = omaflake/catalog on GitHub. Settings → Recipe Sources and omaf sources add, remove, reorder and switch them.
  • Private GitHub repositories: “Private repository” next to the GitHub address shows a token field – a fine-grained token with Contents: Read-only on that repository. omaflake checks it (the repository over the GitHub API, then the catalog) before it keeps the source, stores it in the login Keychain (service app.omaflake.recipe-source, never in a file) and reads the repository over the GitHub API (contents/…, raw) with it. Public ones are read from raw.githubusercontent.com without a token. Other private hosts: OPEN.
  • Remote sources are read only when asked – opening the Recipes tab, its refresh button, omaf recipes available/install – never in the background (the daily update check stays the only network access omaflake makes on its own, §11.6). Their catalog.json (v4) lists every recipe, module, key binding set and look with metadata, a version and each file with size and SHA-256. Installing a recipe downloads its recipe.toml into <data folder>/recipes/<id>/ (.installed.json: source, version) and what it is made of that is not here yet – its modules into <data>/modules/, key binding sets into <data>/keymaps/, its look into <data>/looks/ (.installed.json there: source, version, content hash; plan B142) – from the first source that has each in a version the recipe allows (the official catalog last). Every file’s size and SHA-256 is checked and the catalog treated as untrusted (paths must stay inside the part’s folder; at most 1 MiB per file, 5 MiB per part); a mismatch installs nothing. Another content hash in the catalog shows as an update. Removing deletes the folder; images built from it stay (a recipe whose module is removed cannot be built until it is back).
  • Local folders need no catalog: omaflake uses their recipes as they are on disk, so a changed file is built the next time – how recipes are written and tested. During omaflake’s own development the data folder’s source is the local checkout of omaflake/catalog (CLAUDE.md), not the remote repository.
  • Into the build: before every nix call omaflake puts the recipes together – the enabled local folders first (in their order), then the downloaded ones; the first with an ID wins – into <data folder>/cache/recipes/<content hash>/ – each recipe in a tree of its own with the modules and key binding sets it uses, in a version it allows – and passes it as --override-input omaflake-catalog path:… (the same content gives the same folder; the last 8 are kept). An image’s revision is its recipe’s: git revision of a local folder (-dirty with changes in the recipe’s folder), the catalog version of a downloaded one.
  • Presets and the first start: omaflake’s recipes live in omaflake/catalog (also lab). With nothing installed, the Recipes tab offers “Install suggested”: the official ones (no lab recipes). Official means by omaflake and from omaflake/catalog on GitHub (the former omaflake/recipes is retired; settings naming it are migrated) – a fork’s copy or an author name alone is not; recipes from other sources carry a note that the omaflake team has not reviewed them.
  • Marketplace: omaflake/catalog is the curated catalog: other developers submit recipes, modules, key bindings and looks by pull request; the core team reviews them for security, fitness and added value (REVIEW.md there), CI checks the format (tools/catalog.py --check); evaluating and building each submitted recipe in CI: OPEN (needs omaflake/omaflake public or a token). Tags come from one list (tags.toml), so the Recipes tab can filter by them. Anyone can run a source of their own (FORKING.md there). Export (a recipe’s folder as a file) and signing or pinning a catalog: OPEN.
  • Generic images: nothing personal in an image; user, SSH keys, language and keyboard reach the instance at its first start (NixOS: e.g. systemd credentials via SMBIOS – OPEN; macOS: over SSH, as the host name today). Generic NixOS images from a public flake can then come from a binary cache instead of being built.
  • macOS stays local: IPSW from Apple, base and images are always built on the user’s Mac.
  • The base always works: omaf macos install needs no flake and no recipe – a macOS base can be created on any Mac that meets §11.2, whatever recipes are installed.

11.5 Admin tasks from the app (DECIDED 2026-10-17; root only for Nix since 2026-11-22)

Since plan B160 (2026-11-22, release 0.7.4): root is needed once – installing Nix (with --no-modify-profile, flakes and the user among trusted-users). omaflake no longer sets up nix-darwin: its Linux builder runs as the user (a LaunchAgent, files in the data folder, handed to Nix with --builders), Nix in the shell is a block in ~/.zshrc, its SSH key is its own. One button, “Set Up for NixOS”, runs every step with visible progress (docs/linux-builder.md). A Mac with nix-darwin’s builder keeps it. The text below is the state before.

Installing Nix (APFS volume /nix, /etc/synthetic.conf, nixbld users, nix-daemon), activating nix-darwin and setting up or changing the Linux builder (a launchd system daemon whose SSH key only root can read) all need root. Everyday work (QEMU from Nix, macOS base, images, VMs) does not.

  • Now: the app runs admin tasks itself with macOS’ standard administrator dialog (AppleScript do shell script … with administrator privileges, AdminShell in OmaflakeCore; the command is passed as an argument, never spliced into script source). Every task is confirmed in the app first and logs to <data>/logs/. The CLI runs the same scripts through sudo. Implemented: Doctor → Linux builder → “Apply Settings …” (build …#linux-builder as the user, then set the system profile and activate as root – root may not read ~/Documents; warns when the running nix-darwin system is not omaflake’s – marker /etc/omaflake/linux-builder) and “Clean Up …” (nix-store --gc in the builder); omaf builder apply|clean-up. Whether the dialog offers Touch ID on macOS 27: OPEN.
  • Implemented 2026-10-17 (plan B54), to try on a Mac without Nix: Nix with the NixOS community’s official installer, nix-darwin with the builder host in two stages. Earlier plan text:
  • Planned (milestone before release, with M12): set up the prerequisites by click – Nix, nix-darwin with the builder host – from the Doctor, each through the administrator dialog, so a Mac without Nix gets from “download the app” to “first VM” without Terminal. To clarify first (OPEN): which installer (nixos.org multi-user script or Determinate Systems’ .pkg), whether Determinate Nix and nix-darwin both managing /etc/nix/nix.conf fit together, pinning installer versions/checksums, detecting and leaving alone an existing Nix or nix-darwin configuration.
  • After Developer ID signing (M12): a privileged helper (SMAppService launch daemon in the app bundle) replaces the dialog: the user approves it once (System Settings → General → Login Items), afterwards admin tasks run without a prompt. The helper accepts requests only from the signed omaflake app and only a fixed list of tasks; the app still confirms big steps itself.

11.7 Recipe line-up (DIRECTION 2026-10-17, shaped last – once everything runs)

  • Standard recipes, always there, for both guest kinds: base, minimal, lab. What base holds as a recipe (vs. minimal): OPEN, to shape at the end.
  • lab = development recipes: omaflake’s own (test app, debug tools) and any recipe marked lab = true by its author; the app shows them only in developer mode (Settings; config.json developerMode; omaf recipes --all). In the app a flask marks them. Implemented 2026-10-17 (plan B51).
  • Custom recipes by omaflake: research first (NixOS and macOS); dev (Development) and office are planned for later (taken out 2026-10-17 to perfect research and the app first) – the first examples of what others can publish (§11.3).
  • Every recipe has a description (description, description_<language> in recipe.toml), shown behind an “i” next to its name and below the pickers. Implemented 2026-10-17.

11.8 Hosting (DIRECTION 2026-10-17: own mirrors run by the maintainer)

What Why Where (suggestions; check current terms)
App releases (signed, notarized .dmg/.zip) + checksums download, Homebrew cask, self-update GitHub Releases (primary); mirror: Cloudflare R2 (S3-compatible, no egress fees) or Hetzner Object Storage (EU)
Update feed (appcast, signed) self-update (§11.6) static file on the website (GitHub Pages) or the same bucket
Nix binary cache: qemu-omaflake with virglrenderer/libepoxy (aarch64-darwin) nobody compiles QEMU (~20 min) Cachix (hosted, free for open source); self-hosted: a plain S3 binary cache (nix copy --to s3://…, public bucket on R2/Hetzner/B2, no server) or Attic (server + S3)
Nix binary cache: omaflake’s own guest parts (agents, test app, recipe packages) for aarch64-linux and aarch64-darwin faster image builds same cache; NixOS images themselves are personal (user, keys) and do not cache – generic images later (§11.3)
Pinned nix-installer binary + checksum setup by click without a moving target (B54) same bucket; source: NixOS/nix-installer releases
Website, docs, appcast – GitHub Pages (omaflake/website), domain via any registrar (e.g. INWX, Hetzner), DNS e.g. Cloudflare
Homebrew tap (cask) brew install --cask omaflake GitHub repository omaflake/homebrew-tap
Source omaflake/catalog (§11.3) presets and the curated catalog GitHub repository; optional mirror on Codeberg (a source can be any HTTPS host)
CI builders build and sign releases, fill the cache GitHub Actions: macOS arm64 runners (app, QEMU), Linux arm64 runners (guest parts) – free for public repositories (check)

Not to mirror: Apple’s IPSW restore images (Apple’s licence – the app downloads them from Apple), nixpkgs (cache.nixos.org already serves it). The cache needs a signing key (nix key generate-secret); its public key and URL go into the builder host’s nix.settings (extra-substituters, extra-trusted-public-keys), so setup by click configures it.

11.6 Self-update (DECIDED 2026-10-17, implementation with M12)

omaflake updates itself when a new release exists. The Doctor shows the running version and the update check against the release’s update.json (implemented, plan B68) and, with releases, the newest one with “Update” and a switch for automatic updates. Everything else works offline; the update check is the only network access the app makes on its own, and it can be switched off. Needs signed, notarized releases (M12); mechanism (Sparkle with signed appcast, or GitHub releases plus signature check of our own): OPEN. Updating the app never touches the data folder; migrations of ~/.omaflake run on the first start of the new version (as ImageStore.migrateLegacy today).

11.9 omaflake agent in every guest (DIRECTION 2026-10-18, design and NixOS prototype 2026-10-18, plan B96; clipboard and camera for NixOS, macOS groundwork: plan B106)

Before it, three single-purpose helpers talked to the Mac, each over its own virtio port: the clipboard helper for NixOS and for macOS and the camera helper for NixOS (Python, ports org.omaflake.clipboard and org.omaflake.camera); readiness and the macOS host name went over SSH. NixOS images from B106 on use the agent; macOS guests still use their clipboard helper (nix/modules/clipboard-agent-macos.py). Direction: one omaflake agent, part of every image (the guest modules vm-guest.nix and darwin-guest.nix, so no recipe can leave it out), talking to omaflake on the Mac over one channel.

  • Transport: a virtio port, as today – omaflake’s QEMU has no vsock device (-device help lists only virtconsole/virtserialport), Virtualization.framework has both (VZVirtioSocketDevice). One port with a framed, versioned protocol (hello with agent and protocol version, then messages per feature); the Mac side lives in omaf-runner (macOS) and in omaflake next to QEMU (NixOS). On a Linux host the same host side is omaf bridge (Rust, the core’s AgentLink; host clipboard and V4L2 camera – plan B126).
  • What it carries: the existing clipboard and camera streams; readiness without SSH (the agent’s hello = “VM ready”, also with network off); live status (load, memory, disk, addresses, logged-in user); host name and guest settings at first start (fits the generic images of §11.3); a clean shutdown request; later forwarding of ports (“tunnels”) started from the Mac, opening a URL on the Mac, notifications from the guest.
  • macOS camera (plan B169, 0.7.5): the agent offers camera in macOS guests too and hands the frames (raw NV12 1280×720) to one reader on 127.0.0.1:47042; a reader connecting asks the Mac for frames, one credit goes back per frame the reader took, so the Mac’s camera runs only while something reads and at the reader’s pace. Apps see a camera only through a Camera Extension (CoreMediaIO system extension), which must be signed – until omaflake’s own (M12) that is OBS’s: the agent writes OBS’s scene collection “omaflake Camera” (a media source reading the stream) when it finds OBS, makes it OBS’s current one, never touches the user’s collections and writes nothing while OBS runs; approving OBS’s extension and “Start Virtual Camera” are the user’s. Nothing installs OBS (a stopgap: nothing may bind omaflake to it). Later omaflake’s extension reads the same stream. H.264 (plan B174): the virtio console carries ~35 MB/s, ~25 raw frames a second – fewer than the camera’s 30. The macOS agent also offers camera-h264; a runner that enables it encodes with VideoToolbox (real time, no frame reordering, 8 Mbit/s, a key frame every 2 s and with every “start”) and each 0x0202 carries one access unit in Annex B (parameter sets before each key frame). Only frames with a credit are encoded, so the stream misses none; the agent takes every frame in order (none replaced) and grants 4 credits. NixOS guests keep raw frames (v4l2loopback). OMAFLAKE_CAMERA_RAW=1 for the runner keeps raw frames. Decoded in the agent, Metal in OBS (plan B183): the reader on 127.0.0.1:47042 always gets raw NV12 – the agent decodes each access unit with VideoToolbox (one picture out for each one in; a new decoder for every reader, which starts with a key frame) and gives the credit back once the picture is written. OBS’s media source decoding H.264 itself (0.7.6 to 0.8.0) held pictures back for about 300 ms (FFmpeg’s frame threads; no option of the source reaches the decoder); a media source left as h264 is changed back to rawvideo. The agent also sets [Video] Renderer=Metal in OBS’s global.ini (OBS 32 and later): a macOS VM has no OpenGL on its graphics device, and Apple’s software renderer drew about one picture a second. Both only while OBS is not running. omaflake’s own extension (plan B184; built, delivered with M12): omaflake-camera (Sources/omaflake-camera) is a CoreMediaIO system extension with one device, “omaflake Camera” – 1280×720 NV12, 30 a second. While an app uses the camera it reads the same endpoint as OBS did (raw frames, CameraStreamReader in OmaflakeKit) and sends each frame on at once; without frames it sends a test picture (grey, a bright bar moving right). It is sandboxed (network client; its app group is its Mach service’s name) and ships in “omaflake Tools.app” (Sources/omaflake-tools; scripts/bundle-tools.sh → omaflake.app Contents/Resources/Guest), which asks macOS to activate it (--remove: to deactivate) and logs the answer to ~/Library/Logs/omaflake/tools.log; the user approves it once in System Settings. omaflake Tools (app.omaflake.guest; the extension app.omaflake.guest.camera) is omaflake’s app in a macOS guest, decided 2026-11-26: a system extension must ship in an app, and permissions a guest feature needs (Accessibility or Input Monitoring for key bindings, the microphone) are given to an app, not to a program started over SSH – so what needs an app in the guest goes there, one bundle to sign, install and approve. The agent stays the core (it runs without a logged-in user and is the same for NixOS); the extension stays a process of its own. Nothing but the camera is in it yet. The app’s entitlement to install a system extension is restricted: ad hoc signed, macOS starts the app only with System Integrity Protection off (an “unchained” guest) – checked; with a Developer ID (and TEAM_ID as the app group’s prefix): OPEN, as is who copies the app into a guest. The agent’s diagnosis passes without OBS where the extension is activated enabled.
  • Trust: the guest is untrusted. The Mac side accepts only the defined messages, everything the guest may cause on the Mac is switched per VM in the app (as clipboard and camera today), and tunnels are started from the Mac only – nothing in the guest can run commands on the Mac.
  • Versions: an image carries the agent it was built with; the Mac side speaks the current and the previous protocol version, the app shows when a VM’s agent is older than that.

Design (DECIDED 2026-10-18; prototype for NixOS: hello and status, plan B96)

  • Language: Rust in the guest, Swift on the Mac. Checked against the image flake’s nixpkgs (2026-10-18): Rust 1.98.1 is in cache.nixos.org for aarch64-linux; the prototype omaflake-agent is a 534 KB binary whose closure is glibc and libgcc, which every NixOS system has anyway. nixpkgs’ Swift 6.2.4 builds for aarch64-linux too, but it is one output (out, plus doc/man) with a 5.4 GB closure (corelibs Foundation alone 186 MB) – a dynamically linked agent would drag the toolchain into every image; linking the Swift runtime statically under nixpkgs was not tried (OPEN, not pursued). Go would fit as well (small static binary); Rust because it has no garbage collector pausing the camera stream and reaches the macOS pasteboard through the objc2 crates (macOS port: OPEN). The cost – the protocol exists twice – is held in check by shared test vectors (nix/agent/testdata/vectors.json), checked by cargo test (runs in the Nix build) and swift test.
  • One port, multiplexed: every feature goes over the one port org.omaflake.agent (QEMU virtserialport; Virtualization.framework VZVirtioConsolePortConfiguration, like the clipboard port today). One device per VM, the version agreed once, features switched in the welcome instead of by attaching ports at start – so switches can take effect while the VM runs. What a single port costs, and the remedy: head-of-line blocking – large messages go in chunks of at most 256 KiB, the camera runs on credits (below), so a control message waits at most one frame (≈ 1.4 MB at ~41 MB/s, B70: about 35 ms); a per-VM switch is enforced by the Mac side dropping that feature’s messages, no longer by a missing port. A second port for bulk data, offered in the welcome, only if measurements ask for it (OPEN). Not vsock: omaflake’s QEMU 11.1.2 has none (-device help: virtconsole, virtserialport, virtio-serial-* only). Not qemu-guest-agent (org.qemu.guest_agent.0, in the images for QEMU’s own use): QEMU only, commands polled by the host, no streams, nothing for macOS guests.
  • Wire protocol, version 1. A frame is a 12-byte header and its payload, integers little endian:

    Offset Field  
    0 magic OMFA
    4 type u16, table below
    6 flags u16; bit 0 MORE: the payload continues in the next frame of the same type
    8 length u32 payload bytes, at most 2 MiB (a 1280×720 NV12 frame is 1,382,400)

    The header never changes (a different header would get a different magic); the protocol version is agreed per connection. Control payloads are JSON (UTF-8, camelCase keys); camera frames are binary. A receiver skips types it does not know by their length and drops bytes up to the next magic after a bad header.

    Type Direction Message  
    0x0001 guest → Mac hello agent version, protocol range {min, max}, OS, kernel, host name, boot id, features
    0x0002 Mac → guest welcome chosen protocol, enabled features, status interval, Mac side’s name
    0x0003 guest → Mac status uptime, load, memory, disk, addresses, users with a session
    0x0004 guest → Mac goodbye the agent stops (shutdown, restart)
    0x0010 Mac → guest shutdown clean shutdown request (replaces ACPI/SSH, later)
    0x0011 Mac → guest settings host name and guest settings at first start (later, §11.3)
    0x0100 both clipboard {"mime", "data"} (text/plain;charset=utf-8 or image/png, base64), in MORE chunks of 256 KiB, at most 32 MiB of content
    0x0200 guest → Mac camera control {"action": "start" \| "stop"}: an application opened or closed /dev/video42
    0x0201 guest → Mac camera credit {"credits": n}: n more frames may come (the Mac caps them at 4)
    0x0202 Mac → guest camera frame one 1280×720 NV12 frame (1,382,400 bytes), or with camera-h264 one H.264 access unit (Annex B); always one frame, never chunked
    0x0203 Mac → guest camera status {"status", "detail"} (ready, streaming, unavailable, stopped)
    0x03xx, 0x04xx   tunnels; open URL, notifications later
    0x0500 Mac → guest MIDI endpoints {"endpoints": [{id, direction ("in" \| "out"), name, manufacturer?, model?, protocol (1 \| 2)}]}: the whole list after each change
    0x0501 both MIDI data records id u32, protocol u8, flags u8, words u16 [+ time u64 when flags bit 0] + UMP words (u32), whole UMP messages only, at most 64 KiB, never chunked
    0x0502 guest → Mac MIDI status {"endpoints": n, "failed": [names]}
    0x0503 / 0x0504 Mac → guest / guest → Mac MIDI ping / pong at most 64 bytes, echoed at once (round trip, once a second)
    0x0600 Mac → guest diagnosis request {"id": u32, "check", "args"?} – one check of the VM’s diagnosis (plan B162), answered once
    0x0601 guest → Mac diagnosis answer {"id", "check", "status" ("pass" \| "fail" \| "confirm" \| "skipped"), "detail", "data"?}

    Implemented (B96, B106, B161): 0x0001–0x0004, 0x0100, 0x0200–0x0203, 0x0500–0x0504. MIDI (plan B161): every MIDI endpoint of the Mac (CoreMIDI, except omaflake’s own: property app.omaflake.mirror) becomes a virtual endpoint in the guest with its name, manufacturer, model, protocol and unique id; id is the Mac endpoint’s CoreMIDI unique id, 0 the VM’s own pair (“omaflake " on the Mac, "omaflake Mac" in the guest). Mac → guest: data from a source, read on an input port of the source's protocol (no conversion); guest → Mac: data the guest's apps played to a virtual destination, sent to the Mac endpoint of that id only. Limits on the Mac side: whole UMP messages, 1 MiB/s on average with 512 KiB bursts, unknown ids dropped, the status rate-limited like status. Guest: macOS through CoreMIDI's C API (virtual endpoints need no driver or entitlement); NixOS through the ALSA sequencer (client "omaflake", one port per endpoint; MIDI 2.0 as UMP where the kernel's sequencer has it, Linux 6.5+, else MIDI 1.0 events converted from and to UMP). **Host sides:** VZ guests (macOS) – `omaf-runner run --midi`; QEMU guests (NixOS) on a Mac – `omaf-runner bridge --midi` with the same CoreMIDI bridge; on a Linux host – `omaf bridge --midi` with the host's ALSA sequencer ports (every port that can be read or written, except omaflake's own and the kernel's system/announce ports; the client name "omaflake " for the VM's own pair). The VM's `midi` switch decides, for every guest kind. **Timestamps (plan B161, C7):** the record's byte 5 is `flags`; bit 0 set: 8 bytes `time` (u64 LE) follow the header – nanoseconds of the sender's monotonic clock when the data arrived from its MIDI system (CoreMIDI's event list time stamp, ALSA's event time; data without one are stamped on arrival). Other bits are malformed. The receiver maps the sender's clock onto its own: `offset` = the smallest `own_now − time` seen over the last 30 s (a window that keeps the newest minimum when it slides), and hands the data to its MIDI system for `time + offset + 2 ms` (CoreMIDI: the event list's time stamp in host ticks; ALSA: an event scheduled on the client's real-time queue). A time already past, or more than 1 s ahead, is delivered now. So the jitter of the transport is smoothed by up to 2 ms, and notes keep their spacing. **UMP endpoints (plan B161, C7):** an endpoint of the list may carry `ump` – what a MIDI 2.0 device says of itself (CoreMIDI's `MIDIUMPEndpoint` and `MIDIUMPFunctionBlock`, macOS 15+; ALSA's UMP endpoint and block info): `{"name", "productInstanceId", "manufacturer"? (3 bytes as lowercase hex, no separators: "00213b"), "family"? (u16), "model"? (u16), "version"? (4 bytes, the same: "01020304"), "staticBlocks": bool, "blocks": [{"id" (0–31), "name", "direction" ("in" | "out" | "both"), "firstGroup" (0–15), "groups" (1–16), "midi1" ("no" | "yes" | "low-speed"), "uiHint" ("unknown" | "receiver" | "sender" | "both")}]}` (a direction the sender does not know is "both") – at most 32 blocks, names at most 98 bytes. The guest mirrors it where its MIDI system can (macOS 15+: a `MIDIUMPMutableEndpoint` with its function blocks; Linux: the sequencer client's UMP endpoint and block info) and else ignores it; the data, MIDI-CI included, pass either way. **Connection:** the guest says hello when the Mac side is there (Linux: the port's `POLLHUP` clears) and again every 5 s until a welcome comes; the Mac answers each hello with a welcome. Version: the highest both speak; with none in common there is no welcome, and the app shows why. **Flow control for the camera:** credits – the guest grants as many frames as it has buffers free (2) and returns one per frame written to v4l2loopback; the Mac sends a frame only against a credit, otherwise it keeps the newest one and sends it with the next credit (older ones are dropped – live video is never queued); no credit for 2 s stops the Mac camera. That bounds the Mac → guest queue at two frames. **Diagnosis (plan B162):** the agent offers the feature `diagnose` (always, on every guest kind) and answers `0x0600` with one `0x0601` of the same `id` within 15 s (a check that needs longer says so and answers when done; requests are handled one at a time; unknown checks answer `skipped`). Checks and their `args` / `data`: `info` – `data: {os, user?, session (bool: a user is logged in to the desktop), helpers: {clipboard: bool}}` (macOS: the clipboard helper's process; NixOS: true, the agent carries the clipboard); `clipboard-read` – `data: {text}`, the guest's clipboard as text; `clipboard-write {text}` – put it on the guest's clipboard; `share-write {name, text, volume?}` / `share-read {name, volume?}` – a file in one of the guest's volumes (`/Volumes/` on both platforms, §11.13; `name` and `volume` plain file names), `data: {text}` for read, `fail` when the folder is missing; `network` – `data: {addresses, dns (bool, resolves omaflake.app), internet (bool, TCP to 1.1.1.1:443 within 3 s)}`; `sound` – plays a 1 s 440 Hz tone on the guest's default output → `confirm` (only the user hears it) or `fail` with why; `microphone` – records 2 s from the default input → `data: {level}` (RMS 0…1, peak), `pass` above 0.01, else `confirm` ("say something and try again"); `camera` – NixOS: the loopback device and the Mac's last camera status, macOS: the stream, whether OBS reads it, OBS installed and started once, its scene collection and its camera extension's state (`systemextensionsctl list`), each with what to do; `midi` – `data: {endpoints, failed}`. **Relay:** whatever holds the agent link answers a control request `{"command": "diagnose", "check", "args"?}` with the agent's answer (or `{"error"}` after 15 s) – `omaf-runner run` on its control socket, `omaf-runner bridge` and `omaf bridge` on a new `--control ` (the instance's `bridge.sock`); `{"command": "midi"}` gives the host side's MIDI state on all three. The core runs the diagnosis (`diagnostics.run`, api.md) and does the host's half (clipboard token, share file, SSH, the agent's report).

  • Trust on the Mac side (the guest is untrusted):
    1. Limits in the parser: 2 MiB per frame, resynchronisation after bad headers, an error budget (64 bad frames, malformed JSON or unknown types) – then the Mac side stops listening to that VM’s agent and records why.
    2. Guest → Mac only the listed types, decoded into fixed structures; text loses control characters and is cut at 256 characters, lists are capped, numbers must be finite and not negative. Nothing from the guest becomes a command, a path or a file name on the Mac.
    3. Rate limit per type (hello, status, goodbye: at most every 0.5 s); clipboard: at most 4 contents a second; camera credits capped at 4; a feature’s messages are dropped unless the welcome enabled it.
    4. Effects: hello and status only update the instance’s agent.json (shown by CLI and app). Anything else needs the VM’s switch for that feature (clipboard writes the pasteboard, camera start turns on the Mac camera with the system’s indicator); later, “open a URL” only for http/https and after a confirmation, notifications with the VM’s name and rate-limited; tunnels only started from the Mac.
    5. Readiness and the reported host name are for display; no security decision rests on them (SSH keeps its own host keys).
    6. The Mac side runs as the user (NixOS: the omaf-runner bridge process next to QEMU; macOS: inside omaf-runner), without extra rights for the agent.
  • Guest side. NixOS: the system service omaflake-agent, started by udev when its port appears, as root without capabilities and in systemd’s sandbox; features that need root later (host name, shutdown) get exactly their capabilities. The clipboard needs the user’s Wayland session: the session mode of the same binary (omaflake-agent session, a systemd user service) connects to the system agent over /run/omaflake-agent/session.sock (group users) – one owner of the port, local clients. The camera: the system agent itself drives /dev/video42 (v4l2loopback). It writes what the welcome enabled to /run/omaflake-agent/welcome.json for the guest’s own tools. macOS: the same binary builds for aarch64-darwin (status from sysctl, getloadavg, utmpx; port /dev/cu.org.omaflake.agent; runtime folder /var/run/omaflake-agent; session clipboard via pbcopy/pbpaste and the pasteboard’s change count, text only – PNG OPEN). How it starts in the guest – a LaunchDaemon, which nix-darwin’s launchd items announce as a background item in every clone (BM25), or over SSH like today’s clipboard helper – is the maintainer’s decision (OPEN); until then macOS guests keep the old clipboard helper.
  • Migration in steps, each one working with old and new images:
    1. Agent beside the helpers – hello and status, NixOS VMs ready without SSH, omaf agent (done, B96).
    2. Clipboard into the agent (NixOS) – done (B106). The old ports stay attached for images built before; the Mac side serves the old port and switches to the agent when its welcome enables clipboard (such an image no longer runs the old helper).
    3. Camera into the agent (NixOS), with credits – done (B106).
    4. macOS guests: the Mac side is done (B106: omaf-runner run --agent-state attaches the port, agent.json is read by CLI and app, the clipboard moves to the agent when the welcome enables it); the agent builds for macOS. Open: how it starts in the guest (BM25, above), the host name over the agent (replaces VZBackend.applyHostName), PNG in the guest’s pasteboard; the camera once the Camera Extension is signed (M12).
    5. The Python helpers and their ports go (during development: to _to_delete/) when images without the agent are no longer supported.
  • Update path: the agent is part of the image, built by the same image flake; it never updates itself inside the guest (a guest fetching and running code from outside would break both reproducibility and the trust direction). A newer agent comes with a rebuilt image and upgrade. The Mac side speaks the current and the previous protocol version; the app shows “older than this omaflake – rebuild the image” when the agent’s newest version is older than the current one, and the link stays off only when there is no version in common. New message types and new optional JSON fields do not raise the version (receivers skip and ignore them); changed meanings or removed fields do.

11.10 Portable packages: backup, external VMs, sharing (DECIDED and implemented 2026-10-18, plan B108, B109)

VMs, images and recipes leave omaflake and come back as packages: a folder with an extension that the Finder shows as one file (registered by the app as document types, com.apple.package) – <name>.omaflake-vm, <name>.omaflake-image, <author>.<kind>.<name>.omaflake-recipe. Inside: what the data folder keeps anyway, plus a manifest.json (format, kind, name, time, omaflake version; informational – the content describes itself). No archive format: copying a package is a backup, on the same APFS volume a clone (instant, no extra space); across volumes files stay sparse (an 80 GB macOS disk takes on an external disk what it uses).

  • The data folder is the transport format. Images and VMs are stored as packages in images/ and instances/; NixOS images are self-contained (disk.qcow2 copied out of the Nix store – no GC root, no Nix store needed to run them; about 7 GB more on disk until Nix collects the store path), and an overlay names its image by a path relative to its package. Runtime files live outside the package in run/<name>/. So the user can also copy packages in the Finder without app or CLI.
  • Who a package is for (policy): a VM carries its user, SSH keys and data – it goes to the same person only (a backup, their other Mac, their external disk); an image carries the user it was built for – kept, not shared; recipes are what people share. Export dialogs say so.
  • Export (omaf export vm|image|recipe, app: Export … in the details): a VM only when stopped (a snapshot). A NixOS VM always carries its image (image.omaflake-image/ inside, the overlay rebased onto it), a macOS VM only when it needs it to start (ephemeral) or with --with-image (for a reset elsewhere). A recipe goes alone (recipes/<author>/<kind>/<name>/recipe.toml): its modules come from the receiver’s sources.
  • Import is always a copy into the data folder (plan B109; omaf import, app: the Import button of each tab, double-click, drop on the app). Nothing is moved, the source is never changed; everything is assembled in a hidden .partial folder and moved into place at the end. By extension; a plain folder with recipes (<author>/<kind>/<name>/recipe.toml, a checkout, one recipe folder) imports as recipes. The tab’s open panel offers only its kind and checks the content before it closes (a VM needs instance.json, an image image.json and its disk, recipes recipe.toml). What is here already is asked about first:
    • VM of the same name: cancel (“I have it already”) or a new name – then it is a second VM with its own identity (SSH port; macOS machine identifier and MAC through omaf-runner clone). Under its own name it is the same VM again (a backup coming back). The image it carries becomes an image of the data folder unless that one is there.
    • Image of the same name – the same content, names carry the store hash: cancel or replace (refused while a VM on it runs).
    • Recipes never conflict (§11.11, plan B110): the same author, kind, name and content is here already – nothing to import; other content is a recipe of its own next to it (source import), nothing is replaced. Remote recipe sources are set in Settings; images are never used from elsewhere (an image elsewhere makes no sense – a VM carries the one it needs).
  • External VMs – run from where they are (app: the second button of the VMs tab; omaf external add): a VM package on an external disk, a stick used on several Macs, a NAS or any folder is registered in config.json (externalVMs), nothing is copied. A NixOS VM must carry its image (an exported one does). On a network volume the app warns first (slower, breaks with the connection). While its place is there the VM is listed (marked with a drive, “Runs from” in its details); gone, it disappears. Stop Listing / omaf external remove drops the registration (also while the place is gone), Remove deletes the VM at its place (the dialog says so), Import copies it into the data folder and ends the registration. Sockets stay on the Mac (run/<name>/), so long volume paths do not hit the Unix socket limit (B12); the SSH port moves when the Mac uses it already. OPEN: two Macs using the same external VM at the same time is not prevented across machines (the lock is per Mac).
  • Migration: at the first start of this version (app or CLI) image folders become packages (NixOS: the qcow2 is copied out of the store, the GC root goes), current/ links follow, VM folders become packages with their runtime files moved to run/ and their overlays rebased onto relative paths; skipped while a VM of the old layout runs.

11.11 omaflake IDs and recipe identity (DECIDED and implemented 2026-10-18, plan B110, B111)

One readable ID form for the three kinds of objects – <kind>:<identifier>:<words>:

Kind Example (as shown) Identifier Words from
recipe recipe:omaflake/nixos/minimal:regular author/kind/name the content hash
image image:omaflake/nixos/lab:myth the recipe’s author/kind/name the store path (NixOS image, macOS: the darwin system)
vm vm:research:sister the VM’s name its identity: random when it is made, new for a copy under another name, kept by a restore

Twelve words, shown as few as needed (B111). An ID has twelve words of BIP-39’s English list (2048 words, MIT; checked against its published SHA-256) – 132 bits, unique worldwide like a UUID, also for recipes and images shared between people. The GUI and the CLI show only as many words as tell the objects of a kind apart: one word; as soon as two objects of the same kind and identifier (two versions of one recipe, two images of one recipe) share their first word, every object of that kind shows two words, and so on (OmaflakeID.Lengths). The full ID is in the tooltip and is accepted everywhere, as is any start of its words (@myth, image:omaflake/nixos/lab:myth). The three-word IDs of the first day are the start of the twelve-word ones (the same hash), so they keep working as short forms. Files and Nix attributes use the full file form <author>.<kind>.<name>@<twelve words> – recipe IDs (RecipeID; staged folders, images."…", image.json, instance.json) and image package names (the revision is in image.json); a VM’s package keeps its name (<name>.omaflake-vm), its words are in instance.json.

Recipe identity. A recipe is its author, kind, name and content: the same base with other content is another recipe, also from the same source; the same base with the same content exists once (the first source’s). The source is not part of the ID but of the recipe’s line – source + author/kind/name: images of a line replace each other (current/<line>, retention, “outdated” by store path), VMs upgrade within their line, and image.json records the recipe source. Versions (B111): a line’s versions are kept by the setting “Keep older recipe versions” (Settings, omaf config --keep-recipe-versions on|off, default off): off, only the newest stays when a newer one comes (a catalog update, an import, a changed local folder) – and every version an image is built from, as long as that image is there. So that this holds for local folders too, a build keeps a copy of the version it used in <data>/recipes/<id>/ – a few bytes; the folder can change afterwards (its modules are not kept: OPEN). Versions are removed one by one or all of a line at once (what images use and a local folder’s own recipe stay). Content hash: SHA-256 over the recipe’s sorted file paths and each file’s SHA-256 – the same from a catalog’s file list (RecipeCatalog.Recipe.contentHash), so an offered recipe that is here already (from any source) is recognised before it is downloaded.

Shown only when needed. The app and omaf recipes show a recipe line by its name, its source only when a recipe of the same author, kind and name comes from another source; its versions are always sub-rows with their words, so the words, export and remove always sit in the same place. Local folders count by their absolute path, imported recipes by where they are kept (<data>/recipes). The details show each object’s omaflake ID; omaf list --long, omaf images, omaf recipes --long print them; recipe arguments accept the omaflake ID or <…>@<words>.

Staging. Every recipe gets a tree of its own, <id>/, laid out like a catalog: recipes/<author>/<kind>/<name>/ and the modules and key binding sets it uses in a version it allows (modules/…, keymaps/…, plan B142); recipes.json maps ID → {tree, recipe} for the image flake. Downloaded and imported recipes live in <data>/recipes/<id>/.

Migration (first start): downloaded recipes move to recipes/<id>/; images, current/ links and VMs of old IDs get the ID and source of the recipe of that base there is now; image packages are renamed to <base>@<words> (VMs on them follow – their overlays are rebased); every VM gets an identity. Checked: the six recipes give the same store paths as before.

11.12 Networks between VMs (DECIDED and built 2026-11-25 for 0.7.5, plan B170; checked without real VMs)

Why. VMs should talk to each other across the hypervisor boundary – first case: one NixOS VM with Docker that several macOS VMs use (macOS guests cannot run Docker, plan B170). Without networks they cannot: every QEMU VM has its own NAT (-netdev user, §6.3), macOS VMs share VZ’s NAT (192.168.64.x), and omaflake controls neither. Joining Apple’s vmnet needs root (socket_vmnet) or a restricted entitlement – not an option.

A second card (maintainer’s decision, 2026-11-25). A network is an Ethernet segment omaflake runs itself; a VM joins it with a second network card. Its own card – the NAT with SSH and the internet, the network mode shared / isolated / none – stays exactly as it is, so a VM in no network starts as before. Networks are opt-in.

Side Attachment
NixOS (QEMU) -netdev stream,id=lan<i>,server=off,addr.type=unix,addr.path=<data>/run/net/<name>/qemu.sock,reconnect-ms=1000 + virtio-net-pci,netdev=lan<i>,mac=…,addr=0xa…0xd (QEMU 11.1.2 qapi/net.json)
macOS (omaf-runner) --lan-mac/--lan-socket/--lan-switch: a datagram socket bound to <data>/run/<vm>/lan<i>.sock, connected to …/vz.sock, given to VZFileHandleNetworkDeviceAttachment
Switch omaf network-switch <name> --data <folder> (hidden): one process per network

The switch (crates/omaflake-core/src/networks/) is a learning Ethernet switch in Rust (std and libc, no new dependency): QEMU’s stream frames (a 4-byte big-endian length before each), and one datagram per frame from each runner’s bound path – the sender’s address is kept raw (std’s SocketAddr on macOS drops the last byte of a path bound without a terminating NUL). Its own address .1 answers ARP, ping and DHCP. omaflake starts it before a member VM starts (Networks::prepare); it ends a minute after its last port went, or when its network is removed. A frame it cannot pass on at once is dropped. Every two seconds it writes status.json: ports, the member behind each card, traffic in and out, bytes between VMs. Spike (same day): gvisor-tap-vsock 0.8.9 joins a QEMU and a vfkit client on one segment but serves only one client per kind – a switch of omaflake’s own was needed anyway; with no gateway to replace, gvproxy is not used.

Addresses. Network n (1–254, the first free) is 10.231.<n>.0/24, the switch .1, members 10–254 (the first free when they join; kept while they stay). A card’s MAC is 02:6f:6d:<n>:<host>:00 – the switch’s DHCP server answers from the MAC alone, without leases, and gives no router and no DNS server: the default route stays on the VM’s NAT. A VM is in at most 4 networks (QEMU’s PCI slots 0xa–0xd).

Files. <data>/networks.json (schema networks v1, docs/schema/networks/v1.json): the networks with their members – the only place membership is kept (a VM’s package does not carry it; removing a VM takes it out). Runtime files in <data>/run/net/<name>/: qemu.sock, vz.sock, switch.pid, switch.log, status.json.

Guests. NixOS: NetworkManager brings up a new card with DHCP by itself. macOS: a launchd daemon of darwin-guest.nix runs networksetup -detectnewhardware at every boot, so a card macOS has not seen gets a network service (DHCP). OPEN: both checked in a running guest.

CLI, API, UI. omaf networks [list|create|rm|show|join|leave] (alias net), omaf new --join <network>; API networks.list/create/remove/join/leave (docs/api.md); the Networks tab in the Run group of every UI: the networks as a list (the Credentials page’s shape: members with address and traffic, Add VM …, Take … Out, Remove …), the forms network and networkMember, and the graph – this computer with every VM’s own NAT, each network with its members, addresses, whether each card is connected, and what went between which VMs. The app draws it as a picture, the Linux app as cards, omaf ui as a tree.

Docker VM. The catalog’s recipe nixos/docker (headless; modules omaflake/shell, omaflake/docker): Docker 29 with Compose, listening on /run/docker.sock and TCP 2375 (socket activation, firewall open; the VM’s NAT lets nothing in). Another VM in its network uses it with the catalog’s module docker-client (Docker CLI, Compose, Buildx, DOCKER_HOST=tcp://127.0.0.1:2375) and the forward 2375=<docker VM> (plan B180), or directly at tcp://<address>:2375. The port has no TLS and no login – every VM of the network is root on the Docker VM; the module and the docs say so. Bind mounts work when both VMs have the same volume under the same name: it is /Volumes/<name> in every guest (§11.13). Ports published by containers are reached at the Docker VM’s address, not at the client’s localhost. omaflake itself knows nothing of Docker (plan B187): the Docker VM is a VM like any other, all of Docker is in the catalog’s modules.

Names (plan B179). The switch answers mDNS queries (224.0.0.251:5353, RFC 6762) for <vm>.<network>.local of its members with their addresses – the guests’ own DNS stays as it is. macOS resolves any .local name over mDNS by itself; NixOS guests get Avahi with nss-mdns (vm-guest.nix), and since mdns4_minimal takes only two-label names, the full mdns4 after DNS with /etc/mdns.allow (.local).

Joining while it runs (plan B179). QEMU starts every NixOS VM with four pcie-root-ports on the network slots (the root bus takes no card while running); joining plugs a card into a free one over QMP (netdev_add, device_add), leaving unplugs it; <instance>/run/lan.json keeps which network has which port. macOS VMs change their cards at the next start (Virtualization.framework takes no device while a VM runs).

Ports of other VMs on localhost (plan B180). A VM’s forwards (instance.json; vms.set {forwards}, “5432=docker:5432, 2375=docker”; the VM’s details; omaf set --forwards) go into the agent’s welcome as forwards: [{port, to}] – the target’s address in a network both VMs are in – with the feature forward; the agent listens on 127.0.0.1: and passes each connection on (nix/agent forward.rs). The Mac side: `omaf-runner run|bridge --forward

=
:`, `omaf bridge --forward` on Linux. From the next start; images from 0.8.0 on (an older agent offers no `forward` and gets no list). **Later (OPEN).** Rules per network (internet, host access) and `isolated` for macOS VMs (BM27) – a gateway on the switch (e.g. gvproxy as one port); dragging in the Linux app's and `omaf ui`'s graph; throughput measured against VZ's NAT. Proposed (plan B186): SSH trust between a network's members (Docker over `ssh://`, 2375 opt-in), container ports forwarded by themselves and tunnels as objects, and a Docker VM mounting its members' volumes (§11.13, since plan B187) at the paths the members see them. The macOS app's graph is edited by dragging since plan B181: a VM dropped on a network joins it, an address's menu takes the VM out. ### 11.13 Volumes (DECIDED and built 2026-11-27 for 0.8.1, plan B187; German "Platten") A volume is a folder of the host that VMs share. A VM has none, one or several (at most 8: one PCI slot each for QEMU), and a volume may be in several VMs – as with networks, the user decides. A volume has a name (lowercase letters, digits, dashes, 1–31) and a folder: `/share/` by default, or one the user chose (`volumes.json`). A VM lists its volumes in instance.json (schema v2) with the name it sees each under – by default the folder's name, or one the user gives it for that VM (1–31 bytes, no `/`, `,`, `=`, `:`). That name is the device's tag: one virtio-9p device per volume for QEMU (slots `0x7`, `0xe`–`0x14`), one virtio-fs device per volume for Virtualization.framework (`omaf-runner run --volume =`; not macOS's automount tag). The guest mounts every tag it finds at `/Volumes/` – the same path in macOS and NixOS guests, so paths agree across VMs (a Docker VM's bind mounts): NixOS through `omaflake-volumes.service` (vm-guest.nix: the tags in `/sys/bus/virtio/drivers/9pnet_virtio`), macOS through the launch daemon `omaflake-volumes` (darwin-guest.nix: `AppleVirtIOFSTag` from the I/O Registry, `mount_virtiofs` by root with the guest user as the files' owner; it waits for the Nix store and the devices, plan B189). Changes take effect at the VM's next start. Images from before 0.8.1 mount nothing: rebuild them and upgrade their VMs (in place from 0.8.0 on, B178). **In the macOS Finder.** The Finder lists under Locations only what DiskArbitration mounts – of virtio-fs only the device with macOS's automount tag ("My Shared Files", which omaflake does not use); a volume mounted with `mount_virtiofs` is neither local nor a server's and shows nowhere (plan B189). So: - **Unchained images (plan B190):** omaflake Tools carries an FSKit module of omaflake's (`omaflake-volumes.appex`, file system type `omaflakefs`, a passthrough of a folder). The daemon mounts the virtio-fs device hidden at `/private/var/omaflake/volumes/`, and the user's session mounts the module's volume over it at `/Volumes/` – local, under Locations like an external disk. The module's entitlement is restricted: signed ad hoc it starts only with the boot argument `amfi_get_out_of_my_way=1`, which an unchained image build (and an upgrade in place to one) sets; with a Developer ID (M12) every VM can have it. - **Other images:** each volume is a favorite in the Finder's sidebar (taken out again when the volume is gone; the user's own favorites stay). Both run in the user's session, started by omaflake over SSH with the other guest helpers (`omaflake-volumes-session`): a launch agent may not add favorites under /Volumes and would bring a background item notice at every start (plan BM25). omaflake's launch daemons (and nix-darwin's) start through `/usr/local/libexec/omaflake`, so macOS names their background items "omaflake", not "sh" (BM25); allowing them without any notice needs managed login items from an MDM server (plan B191, after the Developer ID). Migration: a VM from before (instance.json v1) with `share` on has one volume named after itself, its folder `share/` or its `sharePath`. Removing a volume takes it out of its VMs and forgets it – its folder always stays; removing a VM deletes the default folder of its own volume only when nothing but metadata is in it and no other VM has the volume. API: `volumes.list/create/remove/attach/detach/rename/reveal`, `vms.create`'s `volumes`; CLI `omaf volumes`, `omaf new --volume [=]`; the tab Volumes (Credentials page shape, its VMs as lines, "Add VM" inline) and the New VM form's Volume section (none, a new one, one there is; the name in the VM). **Later (OPEN).** Vaults: volumes encrypted at rest, a file on the host until a VM loads them or the app unlocks them (password, Touch ID, a hardware key); VMs that need the same to start (plan B188, proposed). ### 11.4 Prerequisites for release - **Repository:** `omaflake/omaflake` on GitHub (public since 2026-10-21) holds the public part: app, `OmaflakeCore`, CLI, `omaf-runner`, QEMU build script, flake module (`nixosModules.vm-guest`), the image flake `nix/` (used as `path:`, shipped in the app). The recipes, modules and looks live in `omaflake/catalog` (§11.3); SSH keys and user settings for development in each developer's git-ignored `nix/local/` (template `nix/local.example/`). - **License (DECIDED 2026-10-19, plan B112):** **AGPL-3.0-or-later** for omaflake's own code (app, CLI, runner, agent, image flake, scripts – SPDX header in each source file); the catalog (`omaflake/catalog`) stays **MIT**, so recipes can be copied and adapted into any source; QEMU patches GPL-2.0-or-later like QEMU; try-omarchy and startergo patches MIT; the BIP-39 word list MIT. No App Store distribution (its terms conflict with the AGPL; the sandbox would not allow omaflake anyway). Images built by omaflake contain the guest agent (AGPL) – whoever passes images on passes its licence on. - **Dependencies:** - tart (`FSL-1.1-ALv2`, BM2): **dropped** – own runner; do not copy tart code as a template. - Cirrus Labs images: **dropped** – base from Apple's IPSW (downloaded by the user, Apple license terms apply). - QEMU (GPL-2), virglrenderer, libepoxy, ANGLE: open source; not shipped in the app (§11.2), built from the flake's sources. - **ANGLE:** from nixpkgs, built from source, BSD-3-Clause (2026-10-17, plan B55) – the prebuilt bottle is gone. - **startergo patches** (virglrenderer macOS patch, libepoxy EGL patch): no LICENSE file, but his README and formulae state MIT (checked 2026-10-17) – used under MIT with attribution (`qemu/patches/startergo/NOTICE`). Nice to have: ask him to add a LICENSE file. - try-omarchy (MIT): carry over its notices. - **Owner (DIRECTION 2026-10-19):** omaflake becomes a project of **falkOSS** (falkOSS – Falcon Lake Open Source Software gUG (haftungsbeschränkt) i. G., a non-profit, github.com/falkoss). The gUG signs the app as an Apple organization before the first public release, so the Team ID does not change after it (a later change means re-signing; users grant camera, microphone and the helper once more). - **Signing/notarization (OPEN):** Developer ID, entitlements `com.apple.security.hypervisor` (QEMU) and `com.apple.security.virtualization` (`omaf-runner`); distribution e.g. via Homebrew cask. - **User prerequisites (OPEN: document, check in the app):** Nix and a Linux builder for NixOS images (omaflake's own since 0.7.4, set up by the Doctor; §11.2); nothing additional for macOS guests. - **Name:** **omaflake** (2026-10-16), CLI **`omaf`**, runner `omaf-runner`. GitHub organization **`omaflake`**, repository **`omaflake/omaflake`**. crates.io: every crate published under its name (plan B192). Domain, other package registries (npm, PyPI, RubyGems, nixpkgs, Homebrew, App Store) and name collisions: OPEN. Trademark search (DPMA/EUIPO/USPTO): OPEN.