Ask for the region on the first screen and hand it to target setup

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 23:20:36 -04:00
1 parent 073f7b2fc0
commit c1d5725837
5 files changed
+93 -3

No files matched your search

@@ -65,6 +65,12 @@ class InstallContext:
defer_provisioning = bool(omarchy_install.get("defer_provisioning")) or defer_provisioning_marker is not None
omarchy_install["defer_provisioning"] = defer_provisioning
# Autoinstall configs written before regions existed install Global.
region = omarchy_install.get("region", "global")
if region not in ("global", "china"):
raise RuntimeError(f"omarchy_install.region must be global or china, not {region!r}")
omarchy_install["region"] = region
if creds_path.exists():
user_credentials = json.loads(creds_path.read_text())
elif defer_provisioning:
@@ -1098,6 +1098,7 @@ def _run_target_setup_command(ctx: InstallContext, cmd: list[str], *, user: str
f"OMARCHY_USER_NAME={ctx.full_name}",
f"OMARCHY_USER_EMAIL={ctx.email}",
f"OMARCHY_MIRROR={mirror_channel}",
f"OMARCHY_REGION={ctx.omarchy_install['region']}",
f"OMARCHY_ISO_REF={_iso_ref()}",
f"OMARCHY_RUNTIME_PACKAGE={_omarchy_runtime_package()}",
f"OMARCHY_SETTINGS_PACKAGE={_omarchy_settings_package()}",