Ask for the region on the first screen and hand it to target setup
This commit is contained in:
1 parent
073f7b2fc0
commit
c1d5725837
5 files changed
+93
-3
No files matched your search
@@ -216,7 +216,10 @@ keyboard_form() {
|
||||
say --foreground 8 "Press Ctrl+C to prepare this machine for another owner."
|
||||
echo
|
||||
|
||||
omarchy_prompt_keyboard && status=0 || status=$?
|
||||
omarchy_prompt_region && status=0 || status=$?
|
||||
if ((status == 0)); then
|
||||
omarchy_prompt_keyboard && status=0 || status=$?
|
||||
fi
|
||||
((status == 0)) && break
|
||||
|
||||
# Esc means "back", and nothing precedes the first screen, so re-ask.
|
||||
@@ -298,7 +301,8 @@ Full name,${full_name:-[Skipped]}
|
||||
Email address,${email_address:-[Skipped]}
|
||||
Hostname,$hostname
|
||||
Timezone,$timezone
|
||||
Keyboard,$keyboard" |
|
||||
Keyboard,$keyboard
|
||||
Region,${region^}" |
|
||||
gum table -s "," -p | sed "s/^/${PADDING_LEFT_SPACES}/"
|
||||
|
||||
echo
|
||||
@@ -801,6 +805,7 @@ run_partition_execute() {
|
||||
"custom_commands": [],
|
||||
"omarchy_install": {
|
||||
"mode": "protected",
|
||||
"region": "$region",
|
||||
"target_mount": "/mnt",
|
||||
"boot": {
|
||||
"esp_mount": "$esp_mount_in_target",
|
||||
@@ -1139,6 +1144,7 @@ cat <<-_EOF_ >user_configuration.json
|
||||
"custom_commands": [],
|
||||
"omarchy_install": {
|
||||
"mode": "full_disk",
|
||||
"region": "$region",
|
||||
"defer_provisioning": $defer_provisioning,
|
||||
"target_mount": "/mnt",
|
||||
"boot": {
|
||||
|
||||
@@ -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()}",
|
||||
|
||||
Reference in new issue
Block a user