Contributing

omaflake is a Rust workspace (crates/: the core omaflake-core, the program omaf (package omaflake), omaflake-sdk, omaf ui (omaflake-tui), the Linux app (omaflake-gui), omaflake-i18n, omaflake-macros – all on crates.io, published by the release workflow on a tag v* once CI passed for that commit; the guest agent nix/agent is omaflake-agent) and a Swift package (the macOS menu bar app and omaf-runner), plus the image flake in nix/ and the QEMU build in qemu/. It runs on macOS (Apple silicon) and on Linux hosts (Linux). Recipes are not here: they live in omaflake/catalog.

Build and test

cargo fmt --all --check            # format (Rust 2024 style)
cargo clippy --all-targets         # lints
cargo test                         # the Rust workspace (also on Linux)
swift build                        # the macOS app and runner (Mac only)
swift test                         # unit tests
scripts/sign-runner.sh             # after changes to omaf-runner (Virtualization.framework entitlement)
scripts/bundle-app.sh              # build/omaflake.app

The Rust toolchain is pinned in rust-toolchain.toml (rustup picks it up). Dependencies have exact versions, each the newest that is at least 14 days old: after changing Cargo.lock, run scripts/check-age.py (and scripts/check-age.py --dir=nix/agent for the guest agent); cargo deny check (CI) checks advisories, licences and sources.

After changes to Nix:

nix flake check
nix flake check "path:$PWD/nix"
nix flake check "path:$PWD/nix" --override-input omaflake-catalog "path:$PWD/../catalog"

To build images from recipes you are working on, add your checkout of omaflake/catalog as the first source (omaf sources add <path> --first) and point omaflake at the image flake of your checkout (omaf config --flake "$PWD/nix") – or keep your own data folder apart: VM_HOME=~/.omaflake-dev scripts/bundle-app.sh, then scripts/dev-app.sh starts that build with ~/.omaflake-dev, this checkout’s image flake and ../catalog as the first source (your installed omaflake and ~/.omaflake stay untouched). MIDI end to end: scripts/miditest.swift (swiftc -O scripts/miditest.swift -o build/miditest, then build/miditest vm <vm>). Personal Nix settings for your guests go into nix/local/ (git-ignored; template nix/local.example/).

Rules

  • Sign off every commit (git commit -s): with it you confirm the Developer Certificate of Origin. There is no CLA; CI checks the sign-offs of a pull request.
  • English in code, comments, documentation, UI and commits.
  • Licence header: every new source file starts with SPDX-License-Identifier: AGPL-3.0-or-later; files that cannot carry a header are listed in REUSE.toml (REUSE, checked in CI).
  • No personal data in tracked files – no names, user names, home paths, keys, host names.
  • No secrets in the repository.
  • Verified before claimed: check Nix options, QEMU parameters and Virtualization.framework API; mark what cannot be verified as OPEN.
  • Files are an interface: a change to a file omaflake writes raises its version, adds a migration step and a new schema in docs/schema/ (file schemas).
  • Design and decisions are in the design (spec); findings carry ids B… (general) and BM… (macOS).