Repository navigation
feat(computer): Omarchy computers, a base built from Omarchy's own image with cua-driver composed on it as a thin disk - #589
Merged
Conversation
…er's linux-desktop guest A disk form may name the source its base is built from, a distribution's own VM image by URL and sha256. A computer's forms and its disk's init are chosen by platform, a distribution's replacing its OS type's: an Omarchy computer is a disk alone, its init systemd, and a Linux disk with no container form names its image or its source. The computers bundle ships omarchy-4.5, Omarchy's stable 4.5.0 VM image. The QEMU launcher boots a linux-desktop guest, a Wayland desktop on amd64: a virtio GPU at the computer's resolution setting, 4 CPUs and 8 GiB unless sized, TRIM to its disk, and the systemd credentials VM_CREDENTIALS names over SMBIOS, as a builder's boot passes its ssh key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…from Omarchy's image, cua-driver as a layer omarchy_disk builds an Omarchy base from its artifact's source: Omarchy's own image, fetched into this machine's cache and checked by sha256, booted once by the launcher as a linux-desktop guest with root's key as a systemd credential, and made a base by computers/disk/omarchy's recipe over ssh. The recipe refuses an image that isn't the distribution and version its artifact declares, installs cua-driver's Hyprland plugin pinned by URL and sha256, adds agent-env's Hyprland drop-in and the seed unit that hands each boot its deploy's environment (the Linux disk's seed-env), has SDDM log back in after a logout, sets Omarchy's toggles for an unattended desktop, and turns off crash toasts, dictation and its keys, and housekeeping timers. A composed disk installs the driver over ssh with a bash provisioner, its services systemd user units of the graphical session started through with-seed. A disk's VM is sized by platform, Omarchy's at 4 CPUs and 8 GiB, and gate 1 refuses apps on Omarchy, whose disks compose a driver alone for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… disk-only base's computer is written over its disks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd booted Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…own ports reach it, and its time zone a deploy setting Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and staleness given; a launcher running for its use thin_disk.base finds or builds a guest's base: this machine's, else the store's, else built by the OS's own build and packed from its image and key alone, a base whose labels the OS calls stale built afresh. Base carries its image's labels, Windows' expiry among them, in place of an expires field. thin_disk.running launches a launcher container and removes it however its use ends, and answering waits for its guest's ssh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tall no apt, and its session scripts run as the session user An Omarchy disk's base is built from Omarchy's own image, so a base naming an image instead was accepted at put and failed its compose; put refuses it. linux/omarchy installs get a model of their own, as macOS and Windows have, which refuses apt's packages and sources rather than skip them. A session-scoped run script runs as the session user in their home, as the container and macOS paths run it. The gate names a disk-only base's own init, systemd or agentenv-session, where a driver's service would run as root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rchy computer has no ssh, and a time zone is checked before boot DiskForm left out source when it names none, so an agent-env from before sources still reads every disk this one writes, Ubuntu's composed computers among them. A composed Omarchy disk masks sshd: only a compose logs in, and it boots the base. check_computer_settings refuses a timezone that isn't an IANA zone, so a deploy fails at once rather than when the computer isn't ready after its timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…u-24.04 image of its sources The base fixture built ubuntu-24.04 from source on every run, installing its desktop from Ubuntu's archive, and a slow archive timed out every test that uses it. It now pulls the image agent-env published from the same sources, for this machine's platform, and builds it only when they've changed or the pull fails, as the gateway tier's fixtures do; pull_published_else_build takes the platform to pull. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heir published images too disk_test's tools, browser_gateway_test's gateway and playwright_mcp_local_test's image were built from source on every run, installing from Ubuntu's archive and PyPI, and a slow archive timed out the fast tier's disk tests. Each now pulls the image agent-env published from the same sources for this machine's platform, and builds it only when they've changed or the pull fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of FD-5338 (O1). It builds on #577's thin-disk module. The branch has no issue id, so merging won't close the issue.
With this, agent-env makes Omarchy computers end to end on a Linux machine with KVM:
The base:
computers/artifacts/omarchy-4.5/os = linux / omarchy / 4.5.0 / wayland,amd64, session useromarchy, disk form only (Hyprland needs a GPU, which a container doesn't get).resolution(1920x1080) andtimezone(UTC), both deploy phase.omarchy-4.5.[forms.disk]gains an optionalsource = { url, sha256 }. A Linux disk with no container form names itsimageor itssource; an Omarchy disk names itssourceand noimage; a Windows disk names neither. A disk that names no source is written without one, so an agent-env from before sources still reads every disk this one writes, Ubuntu's included.D1 (the local half):
omarchy_disk.basebuilds it once per machine:linux-desktopguest, with root's ssh key passed as an SMBIOS systemd credential.computers/disk/omarchy/recipe.shas root over ssh.The tag is a key of the recipe, the seed reader, the source, and the base's OS and session user.
The recipe (D7, D8, D9):
omarchy 4.5.0.cua-hyprland-plugin0.33.2-3), pinned by URL and sha256.agentenv.lua, required last fromhyprland.lua, sets up:ufw, new since the first VM run below): it lets in only ssh and LocalSend, while the launcher forwards only the computer's own ports.The launcher's
linux-desktopguest (D3)It boots like
linux, with these differences:virtio-vgasized fromAGENTENV_SETTING_RESOLUTION, which is validated before boot;discard=unmapon the disk, so trimming shrinks it;VM_CREDENTIALSpassed as SMBIOS type 11 credentials.It's amd64 only, and refused elsewhere.
Composition (D4, D6)
_composed_omarchy_disksits beside Windows' in the composer. It runsthin_disk.composewithomarchy_disk.GUEST, keyed and reused the same way.provision.sh, as its[install."linux/omarchy"]says:/opt/agentenv/drivers/<name>;/etc/systemd/user:PartOf,AfterandWantedByaregraphical-session.target, withRestart=always;ExecStartgoes throughwith-seed;--global.DISK_INITS["linux/omarchy"] = "systemd", andOS_FORMS["linux/omarchy"] = ("disk",).[install."linux/omarchy"]gets a model of its own,OmarchyInstall, which refuses apt'spackagesandsourcesas macOS' and Windows' do. Installs are looked up by platform, at put and when a stored driver is read back.scope = "session"run script runs as the session user in their home, as on the container and macOS paths.sshd. Only a compose logs in, and a compose always boots the base, never a composed disk.Shared with Windows: one base build
Omarchy is
thin_disk's second guest, so what both OSes did alike now lives inthin_disk:thin_disk.base(guest, key, build, say, registry, stale=…)finds or builds a guest's base:buildand pushed.It also handles the lock, the new admin key, packing and the push. A base whose labels
stalegives a reason against is built afresh, and the reason is logged. Windows'staleis its evaluation's expiry.windows_disk.baseandomarchy_disk.baseare now only their OS's build.Basecarries its image'slabelsin place of Windows'expiresfield. The composer reads Windows' expiry label directly. It's the same string the composed disk's key always used, so Windows bases and disks already in a store or cache are still reused.thin_disk.running(…)launches a launcher container and removes it however its use ends.thin_disk.answering(…)waits for its guest's ssh. Both replace code that the compose, the Windows install and the Omarchy build each had.A base is packed from a folder holding only its image and admin key. So
packno longer deletes Windows'answersfolder, and Omarchy's copy of its recipe stays out of the Docker build context too. Windows' install writesGUEST.fileinstead of"windows".The seed (D5)
agentenv-seed.serviceruns before the display manager. It reads the NoCloud seed with the Linux initramfs's ownseed-env, then:/run/agentenv/environment, readable by root and the session user only, the seed's trust files first;timezoneas/etc/localtime;host.docker.internalat QEMU's 10.0.2.2;resolution.A seed it can't read, or a time zone the disk doesn't have, is written as a refusal, which every service then names when it fails to start. Before that, a deploy whose
timezoneisn't an IANA zone is refused at once bycheck_computer_settings, for Ubuntu'stimezonetoo.boot.DISK_SIZES["linux/omarchy"]is 4 CPUs and 8 GB. Probing and the computer env provider pass the base's platform toboot.Not in this PR
infra_error, is FD-5408.Tests
tst/unit/env/envs/test_computer_omarchy.py(new, 18 tests) covers:DISK_SIZES;argv;test_disk_recipe.pycovers the launcher'slinux-desktopguest and its refusals.test_thin_disk.pyadds two tests for the shared base build:test_computer_windows.py's base tests now go throughthin_disk.base.test_computer_disk.pyexpects a composed Linux disk form to name nosource.tst/unit/env/envs: 956 passed, 2 failed:test_a_builder_boots_on_a_kept_overlay…, which failed once under the full suite's load and passes alone and in 3 of 3 runs of its file.tst/unit/artifact,tst/unit/config,tst/unit/driversand the shipped bundles' test pass.ruff checkis clean.tst/integration/computer/conftest.pybase) now pulls the publishedagentenv-ubuntu-24.04image of its sources for this machine's platform, as the gateway tier's fixtures do, and builds it only when the sources have changed. Building it from source installed its desktop from Ubuntu's archive on every run, and a slow archive timed out all ofbase_computer_test.py.tst/util/published_image.pull_published_else_buildtakes the platform to pull.disk_test.py's disk tools,browser_gateway_test.py's gateway andplaywright_mcp_local_test.py's Playwright MCP. A slow Ubuntu archive had timed out the fast tier's disk tests while it built the disk tools. Re-resolving Chromium's and the test apps' packages on every run is FD-5432.tst/integration/computer/omarchy_test.pycomposes the shipped base with cua-driver and runs the probe task, whose verifier waives nothing.omarchy_imagecapability (the qcow2 in this machine's cache), which is added to the slow tier's allowed skips.Verified on a VM
EC2 with nested KVM, from this branch, starting from Omarchy's stock 4.5 image: runs 1 and 2 on a c8i.2xlarge, the last on a c8i.4xlarge. Docker was on overlay2, as CI's runners are; the containerd image store breaks local disk boots (FD-5416, from #577).
Run 1 (29c9aa2) got as far as the probe boot:
The probe's boot then failed:
the computer … wasn't ready within 180 s (ReadTimeout). Booting the composed disk by hand showed:0.0.0.0:18765and answered 200 from inside the guest;ufw disable, the host got a 200.The recipe now turns the firewall off (d09fcd1).
Run 2 (d09fcd1): 1 passed in 8 min 52 s (
test_the_omarchy_desktop_passes_the_probe_at_full,passed (probe: 1)):Deploy settings, checked by booting run 2's composed disk by hand:
timezone = America/Chicago,resolution = 1280x800/etc/localtimeis Chicago, anddatesays CST in the system and in the session; Hyprland's monitor is 1280×800@60 at scale 1; ufw is inactive and disabled; the driver's card answers 200 from the hosttimezone = Mars/Basewith-seed: its time zone, Mars/Base, is not in /usr/share/zoneinfo, and/etc/localtimestays UTCThat refusal is only in the guest's journal, as D5's refusal of an unreadable seed is: the deploy just reports the computer wasn't ready within 180 s. Since 6f93085,
check_computer_settingsrefuses a zone like that before the computer boots. An unreadable seed still shows only as the timeout.After rebasing onto main and the shared base build (353d92f), on a fresh c8i.4xlarge with nothing cached but Omarchy's image and Windows' ISO:
thin_disk.baseunder the same key as run 2, since its recipe is unchanged. Then cua-driver was composed onto it, and gate 3 probed it at full.windows_test.py -k "probe_at_full or notes_app", 38 min 15 s:thin_disk.base, with_installedonthin_disk.running;ready;test_the_windows_desktop_passes_the_probe_at_fullpassed.before: 1, session: 0, after: 1. Of the session verifier's checks, onlyobliging stopfailed:{"shown": true, "waited out": false, "alive": true, "listed": false}.stop, which this PR doesn't touch. On the path where the window closes when asked,stopreturns once the app's processes have left the job, butalivealso counts the helper holding the job, which can still be exiting.After Greptile's review (3ccec62), on a fresh c8i.2xlarge:
provision.sh, run as root in an Arch container with anomarchyuser, ran its system script asrootand its session script asomarchy, withHOME=/home/omarchy.After the follow-up review fixes (6f93085), on a fresh c8i.2xlarge:
sshdmasked.Connection closedbefore the key exchange: nothing in the guest listens on 22.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge, with no new actionable issues found.Summary
Adds Omarchy computers built from the distribution’s VM image, with cua-driver installed as a thin disk layer.
No new actionable issues were found. The three supplied, unnumbered previous findings are addressed: image-only Omarchy bases are rejected, session scripts use the session user, and Omarchy installs reject apt fields. Tests were not run during this review.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Omarchy VM image] --> B[Check SHA-256] B --> C[Boot and run base recipe] C --> D[Pack and store base] D --> E[Install driver on thin layer] E --> F[Pack composed disk] F --> G[Boot and read deploy settings] G --> H[Start graphical session and driver] H --> I[Run full probe]Reviews (10) · Last reviewed commit: "test: the disk tools', gateway's and Pla..." · Reviewed by Greptile