Skip to content

Source the setup form from the Omarchy runtime - #104

Merged
dhh merged 1 commit into
quattrofrom
shared-setup-form
Aug 10, 2026
Merged

Source the setup form from the Omarchy runtime#104
dhh merged 1 commit into
quattrofrom
shared-setup-form

Conversation

@dhh

@dhh dhh commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

The keyboard layout list, the account and hostname validation rules, and the gum prompts that ask for them existed here and in the runtime's first-boot owner setup, with nothing keeping the copies honest.

They had already drifted. Dropping two layouts from this list in #98 moved English (US) from position 11 to 10, which — because gum choose paginates in --height-sized pages and jumps to the page holding --selected — moved the preselected default from the top of page 2 to the bottom of page 1, leaving it pinned beneath a screenful of layouts nobody scanning for "English (US)" reads.

Where it lives now

The form moves to the runtime at install/provisioning/setup-form.sh (basecamp/omarchy#6669), and build-iso.sh vendors it out of the very runtime package this ISO bundles — the same two-branch machinery already used for omarchy-base.packages: mounted checkout under --local-source, bsdtar out of the downloaded package otherwise. So an ISO ships the form belonging to the runtime it installs, and the installer cannot offer a layout the installed system won't know.

It's extracted on its own rather than alongside the package lists, because bsdtar exits non-zero for a member it cannot find — bundling the request would abort the build under set -e with a bare Not found in archive instead of the actionable error about publishing a runtime that carries the form. Caught by review.

Esc now means back

Unifying cancel handling is what made the prompts shareable: the two sides were byte-identical apart from || abort here versus || continue there. Esc and Ctrl+C are the only keys any gum widget exits on, and they carry distinct statuses, so every prompt reports 0 (answered), 1 (Esc — unwind to the start of the form), or 130 (Ctrl+C — a side channel each caller defines).

Esc previously hit the same || abort as Ctrl+C, so it ended the install outright; there was no way back to an earlier answer. Ctrl+C keeps both of its hidden affordances untouched — arming deferred provisioning on the first keyboard screen, and toggling unencrypted on the disk screens.

English (US) also leads the layout list now, ahead of the other English variants, so the default is the first thing on screen no matter how the list grows.

⚠️ Merge order

Do not merge until a runtime package carrying setup-form.sh is published. Until then every non-local build — including nightly — fails with:

ERROR: omarchy-dev does not ship install/provisioning/setup-form.sh
       The configurator sources its prompts from that file, so this ISO
       would boot into an installer with no questions to ask.

That is deliberate: an ISO built without the form would boot an installer with no prompts, which is worse than a failed build.

— 🤖 Claude, posting on behalf of @dhh

The keyboard layout list, the account and hostname validation rules, and the
gum prompts that ask for them existed here and again in the runtime's
first-boot owner setup, with nothing keeping the copies honest. They had
already drifted: dropping two layouts from this list moved English (US) from
the top of one gum choose page to the bottom of the previous one, leaving the
preselected default pinned under a screenful of layouts.

The form now lives in the runtime at install/provisioning/setup-form.sh, and
build-iso.sh vendors it out of the very runtime package this ISO bundles —
the same two-branch machinery already used for omarchy-base.packages, so a
--local-source build takes it from the mounted checkout and everything else
extracts it from the downloaded package. An ISO therefore ships the form
belonging to the runtime it installs.

That file is extracted on its own rather than alongside the package lists:
bsdtar exits non-zero for a member it cannot find, so bundling the request
would abort the build under set -e with a bare "Not found in archive" instead
of the actionable error about publishing a runtime that carries the form.

Cancel handling is unified with first-boot setup, which is what made the
prompts shareable. Every prompt reports 0 (answered), 1 (Esc), or 130
(Ctrl+C). Esc now unwinds to the start of the form instead of ending the
install — it previously hit the same `|| abort` as Ctrl+C. Ctrl+C keeps both
of its hidden affordances: arming deferred provisioning on the first keyboard
screen, and toggling unencrypted on the disk screens.

test_keyboard.py reads the layout list from a runtime checkout now, and skips
its localectl coverage rather than failing when there is none to read.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 9, 2026 22:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR de-duplicates the installer’s interactive setup form (keyboard/account/hostname/timezone prompts and validation) by sourcing it from the Omarchy runtime, ensuring the ISO installer and the runtime’s first-boot owner setup stay byte-identical and can’t drift.

Changes:

  • Configurator now sources a shared setup-form.sh (vendored onto the ISO or read from a runtime checkout) and updates the flow so Esc means “back” across prompts.
  • ISO build now extracts and vendors install/provisioning/setup-form.sh from the runtime package (or local source), and hard-fails builds if it’s missing to avoid a prompt-less installer.
  • Tests and the QEMU harness are updated to reflect the new source of truth and the reordered keyboard layout list.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/test_keyboard.py Reads supported keymaps from the shared setup-form (when available) instead of parsing the configurator script.
configs/airootfs/usr/share/omarchy-iso/orchestrator/keyboard.py Updates docstring to reflect that unknown-layout guarding is for autoinstall input, not the interactive form list.
configs/airootfs/root/configurator Sources the shared setup form and refactors keyboard/user steps to use shared prompt functions with unified cancel/back semantics.
builder/build-iso.sh Vendors setup-form.sh from the bundled runtime package (or local checkout) and fails the build with an actionable error if missing.
bin/omarchy-iso-test Adjusts keystrokes in the deferred first-boot driver to match the new keyboard list ordering.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/test_keyboard.py
Comment on lines +21 to +25
SETUP_FORM_CANDIDATES = (
Path("/omarchy-source/install/provisioning/setup-form.sh"),
ROOT.parent / "omarchy/install/provisioning/setup-form.sh",
Path("/usr/share/omarchy/install/provisioning/setup-form.sh"),
)
Comment thread builder/build-iso.sh
Comment on lines +174 to +181
if [[ ! -f $setup_form ]]; then
echo "ERROR: $OMARCHY_RUNTIME_PACKAGE does not ship install/provisioning/setup-form.sh" >&2
echo " The configurator sources its prompts from that file, so this ISO" >&2
echo " would boot into an installer with no questions to ask." >&2
echo " Publish a runtime carrying the shared setup form, or build with" >&2
echo " --local-source against a checkout that has it." >&2
exit 1
fi
omarchy_prompt_username || return $?
omarchy_prompt_password || return $?

# Hash the password using yescrypt
@dhh
dhh merged commit 8858ac2 into quattro Aug 10, 2026
1 check passed
@dhh
dhh deleted the shared-setup-form branch August 10, 2026 09:20
dhh added a commit that referenced this pull request Aug 10, 2026
The build's missing-form error only ever described the published-package
case, so a --local-source build against a checkout without the form told
you to publish a runtime or pass --local-source — advice you had already
taken. Branch on /omarchy-source and name the checkout instead.

The password comment has claimed yescrypt since 880d8c5 swapped the
command to `openssl passwd -6`, which is SHA-512 crypt. openssl passwd
cannot produce yescrypt at all, so the comment, not the command, is what
was wrong.

Both spotted by Copilot's review on #104.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants