Skip to content

Commit 536fcd5

Browse files
dhhclaude
andcommitted
Move install-time plumbing out of the setup namespace
setup is where a user goes to configure something: direct boot, security keys, hibernation. These three are not that. omarchy-apply-system is the ISO's entry point in the target chroot, omarchy-apply-hardware is what it calls for device quirks, and omarchy-apply-lock is called by install/config/lockscreen-pam.sh. apply is the verb they already used to describe themselves, and it carries the contract: declared state under install/ converged onto the machine, idempotent, safe to repeat. The group gets no GROUP_DESCRIPTIONS entry on purpose. That table drives the top-level group list on its own, so an entry would put apply back in front of users even with every command in it hidden, the way provision already stays out. A test covers it. The ISO installs the runtime from the mirror it ships with, so it moves to the new names in lockstep and no compatibility route is needed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 477284f commit 536fcd5

11 files changed

Lines changed: 40 additions & 34 deletions

‎agents/skills/install-scripts.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Read this before working under `install/` or on the system/user setup commands.
55
The ISO owns installation orchestration. This repo ships target-side setup
66
commands and reusable setup leaves:
77

8-
- `bin/omarchy-setup-system` runs root-owned system setup during ISO finalization.
9-
- `bin/omarchy-setup-hardware` runs idempotent hardware-specific setup and is called by `omarchy-setup-system`.
8+
- `bin/omarchy-apply-system` runs root-owned system setup during ISO finalization.
9+
- `bin/omarchy-apply-hardware` runs idempotent hardware-specific setup and is called by `omarchy-apply-system`.
1010
- `bin/omarchy-finalize-user` runs the per-user runtime finalization (skill symlinks, xdg-user-dirs, mime defaults, `install/user/all.sh`). Shipped user defaults are seeded by `/etc/skel` from `omarchy-settings`, not by this command. `bin/omarchy-reinstall-configs` is the explicit destructive resync of those defaults into an existing user's `$HOME`.
1111
- leaf scripts under `install/` are sourced by `run_logged $OMARCHY_INSTALL/path/to/script.sh` and intentionally do not have shebangs.
1212
- avoid `exit` in sourced setup scripts unless intentionally aborting setup.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#!/bin/bash
22

33
# omarchy:summary=Apply Omarchy hardware-specific packages and system configuration
4-
# omarchy:group=setup
4+
# omarchy:group=apply
55
# omarchy:requires-sudo=true
6-
# omarchy:examples=omarchy setup hardware --install-user dhh
6+
# omarchy:examples=omarchy apply hardware --install-user dhh
77
# omarchy:hidden=true
88

99
set -euo pipefail
1010

1111
usage() {
1212
cat <<USAGE
13-
Usage: omarchy setup hardware --install-user USER
14-
omarchy setup hardware --defer-provisioning
13+
Usage: omarchy apply hardware --install-user USER
14+
omarchy apply hardware --defer-provisioning
1515
1616
Runs idempotent hardware detection/setup for the installed machine. This is
17-
called by omarchy-setup-system during ISO finalization and can be rerun later
17+
called by omarchy-apply-system during ISO finalization and can be rerun later
1818
for diagnostics or after hardware/package updates.
1919
2020
--defer-provisioning runs without an install user (deferred-provisioning installs create the user at
@@ -47,7 +47,7 @@ while (($#)); do
4747
done
4848

4949
if (( EUID != 0 )); then
50-
echo "Error: omarchy-setup-hardware must run as root" >&2
50+
echo "Error: omarchy-apply-hardware must run as root" >&2
5151
exit 1
5252
fi
5353

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22

33
# omarchy:summary=Configure Quickshell lock screen authentication
4-
# omarchy:group=setup
5-
# omarchy:name=lock
64
# omarchy:requires-sudo=true
75
# omarchy:hidden=true
86

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#!/bin/bash
22

33
# omarchy:summary=Apply Omarchy system setup in the installed target
4-
# omarchy:group=setup
4+
# omarchy:group=apply
55
# omarchy:requires-sudo=true
6-
# omarchy:examples=omarchy setup system --install-user dhh --first-install
6+
# omarchy:examples=omarchy apply system --install-user dhh --first-install
77
# omarchy:hidden=true
88

99
set -euo pipefail
1010

1111
usage() {
1212
cat <<USAGE
13-
Usage: omarchy setup system --install-user USER [--first-install|--upgrade]
14-
omarchy setup system --defer-provisioning --first-install
13+
Usage: omarchy apply system --install-user USER [--first-install|--upgrade]
14+
omarchy apply system --defer-provisioning --first-install
1515
1616
Runs root-owned Omarchy system setup. The ISO calls this in the target chroot
1717
after packages are installed and the target user exists. It also calls
18-
omarchy-setup-hardware, so hardware setup cannot be accidentally skipped.
18+
omarchy-apply-hardware, so hardware setup cannot be accidentally skipped.
1919
2020
--defer-provisioning runs without an install user: deferred-provisioning installs create the user at
2121
first boot, so scripts that grant group memberships record them in
@@ -59,7 +59,7 @@ while (($#)); do
5959
done
6060

6161
if (( EUID != 0 )); then
62-
echo "Error: omarchy-setup-system must run as root" >&2
62+
echo "Error: omarchy-apply-system must run as root" >&2
6363
exit 1
6464
fi
6565

@@ -91,9 +91,9 @@ start_install_log
9191
source "$OMARCHY_INSTALL/config/all.sh"
9292

9393
if (( defer_provisioning )); then
94-
omarchy-setup-hardware --defer-provisioning
94+
omarchy-apply-hardware --defer-provisioning
9595
else
96-
omarchy-setup-hardware --install-user "$install_user"
96+
omarchy-apply-hardware --install-user "$install_user"
9797
fi
9898

9999
source "$OMARCHY_INSTALL/login/all.sh"

‎bin/omarchy-provision-owner‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ Timezone,${timezone:-UTC}" |
669669
gum confirm --negative "No, change it" "Does this look right?"
670670
}
671671

672-
# Groups recorded by omarchy-setup-system's scripts at install time
672+
# Groups recorded by omarchy-apply-system's scripts at install time
673673
# (/var/lib/omarchy/provisioning/groups), filtered to groups that exist on this system.
674674
user_groups() {
675675
local groups="wheel" group

‎bin/omarchy-upgrade-to-quattro‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,16 +612,16 @@ configure_snapper_policy() {
612612
}
613613

614614
configure_lock_authentication() {
615-
local setup_lock=/usr/share/omarchy/bin/omarchy-setup-lock
615+
local apply_lock=/usr/share/omarchy/bin/omarchy-apply-lock
616616

617-
[[ -x $setup_lock ]] || fail "$setup_lock is unavailable; lock screen authentication could not be configured."
617+
[[ -x $apply_lock ]] || fail "$apply_lock is unavailable; lock screen authentication could not be configured."
618618

619619
log "Configuring lock screen authentication"
620620
as_root env \
621621
OMARCHY_INSTALL_USER="$target_user" \
622622
OMARCHY_PATH=/usr/share/omarchy \
623623
PATH="$package_path" \
624-
"$setup_lock"
624+
"$apply_lock"
625625
}
626626

627627
create_pre_upgrade_snapshot() {

‎docs/file-layout.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Idempotency marker: `~/.local/state/omarchy/done/finalize-user`, managed
183183
by `omarchy-done`.
184184

185185
The ISO calls it as `omarchy-finalize-user --force --first-install` in the
186-
target chroot as the install user, after `omarchy-setup-system` has finished
186+
target chroot as the install user, after `omarchy-apply-system` has finished
187187
the root-side work.
188188

189189
## Migrations (`omarchy-migrate`)
@@ -255,13 +255,13 @@ the legacy finalization marker from `~/.local/state/omarchy/` into `done/`.
255255

256256
## Root-side install orchestration
257257

258-
`omarchy-setup-system` (root, in chroot) runs target-side setup at ISO
258+
`omarchy-apply-system` (root, in chroot) runs target-side setup at ISO
259259
finalization. It sources:
260260

261261
- `install/config/all.sh` — theme links, lockout limits, lockscreen PAM,
262262
powerprofilesctl shebang fix, docker setup, Snapper retention, locate
263263
index tuning, service enablement, firewall.
264-
- `install/hardware/all.sh` via `omarchy-setup-hardware` — vendor- and
264+
- `install/hardware/all.sh` via `omarchy-apply-hardware` — vendor- and
265265
device-specific kernel modules, udev rules, microcode, wireless regdom,
266266
ASUS / Framework / Intel / Apple / Lenovo quirks.
267267
- `install/login/all.sh` — SDDM theme/session config.

‎install/config/lockscreen-pam.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
omarchy-setup-lock
1+
omarchy-apply-lock

‎test/cli‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,18 @@ if [[ $output == *"omarchy update perform"* ]]; then
182182
fi
183183
pass "hidden update perform compatibility wrapper is not shown"
184184

185-
# The setup group is for interactive wizards. These three are install-time
186-
# plumbing the ISO and install leaves call, so they stay out of the listing a
187-
# user browses -- while still routing, because those callers use the CLI.
188-
for internal in omarchy-setup-system omarchy-setup-hardware omarchy-setup-lock; do
185+
# These three are install-time plumbing the ISO and install leaves call, so
186+
# they stay out of the listing a user browses -- while still routing, because
187+
# those callers use the CLI. A GROUP_DESCRIPTIONS entry would put the group
188+
# back in the top-level listing even with every command in it hidden, which is
189+
# why apply has none.
190+
output=$(timeout 5 "$CLI")
191+
if [[ $output == *"apply"* ]]; then
192+
fail "a group whose commands are all hidden stays out of the top-level listing"
193+
fi
194+
pass "a group whose commands are all hidden stays out of the top-level listing"
195+
196+
for internal in omarchy-apply-system omarchy-apply-hardware omarchy-apply-lock; do
189197
if "$CLI" commands --json | jq -e --arg binary "$internal" \
190198
'.commands[] | select(.binary == $binary)' >/dev/null; then
191199
fail "$internal stays out of the default command listing"
@@ -197,8 +205,8 @@ for internal in omarchy-setup-system omarchy-setup-hardware omarchy-setup-lock;
197205
done
198206
pass "install-time setup plumbing is hidden from the setup wizards"
199207

200-
output=$(timeout 5 "$CLI" setup hardware --help)
201-
assert_output_contains "hidden setup plumbing still routes" "$output" "omarchy-setup-hardware"
208+
output=$(timeout 5 "$CLI" apply hardware --help)
209+
assert_output_contains "hidden setup plumbing still routes" "$output" "omarchy-apply-hardware"
202210

203211
output=$("$CLI" screenshot --help)
204212
assert_output_contains "root alias resolves to command help" "$output" "omarchy-capture-screenshot"

‎test/shell.d/snapper-test.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ grep -Fx 'systemctl disable --now snapper-timeline.timer' "$test_tmp/calls.log"
7171
grep -Fx 'systemctl enable --now snapper-cleanup.timer limine-snapper-sync.service' "$test_tmp/calls.log" >/dev/null || fail "snapshot configure enables cleanup and Limine snapshot sync"
7272
pass "snapshot configure normalizes Snapper policy and services"
7373

74-
setup_system="$ROOT/bin/omarchy-setup-system"
74+
setup_system="$ROOT/bin/omarchy-apply-system"
7575
grep -F 'config/all.sh' "$setup_system" >/dev/null ||
7676
fail "system setup runs the config phase"
7777
grep -F 'config/snapper.sh' "$ROOT/install/config/all.sh" >/dev/null ||

0 commit comments

Comments
 (0)