Skip to content

Add a World / China region for package mirrors and developer tool registries - #13690

Closed
xdanger wants to merge 37 commits into
omacom:quattrofrom
xdanger:feat/china-iso
Closed

xdanger wants to merge 37 commits into
omacom:quattrofrom
xdanger:feat/china-iso

Conversation

@xdanger

@xdanger xdanger commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Packages in mainland China come slowly or not at all from the .org mirrors, and so do the registries developer tools use (#7858, #8697, #11456). This gives an install one region setting, World or China, that decides where both download from. It also lets a region change the preinstalls, and China gets its own apps. The region framework is @xdanger's; the Setup > Region menu and the developer tool registries come from @Raiden-MeixElysia's #15119 and #15118.

Region. A plain-text marker, /etc/omarchy/region (cn, or absent for World), read as data. The installer derives it from the timezone (omacom/omarchy-iso#241): Asia/Shanghai, Asia/Urumqi and their tzdata aliases select China. Hong Kong, Macau and Taiwan belong to no region under any name, and a test keeps it that way. It can be changed at any time under Setup > Region > World / China or with omarchy-region world|china; omarchy-region-current reads it. Profiles live in default/regions/<code>/.

Packages. For China, omarchy-apply-pacman puts Omarchy's China replicas first: the channel's Arch mirror (stable-mirror, rc-mirror or mirror.omarchy.cn) and, ahead of pkgs.omarchy.org in [omarchy], pkgs.omarchy.cn/<channel>, which carries the largest downloads. The .org servers stay as the fallback. Both replicas serve the same signed packages, so no repository or signing key is added; World is the channel templates byte for byte. Install finalization and omarchy-refresh-pacman render through it, and switching to the dev channel refuses a checkout that lacks this machine's profile.

Developer tools. While the region is China, env-bootstrap exports the profile's registries to every shell and the desktop session: npm (npmmirror), pip and uv, Go (with GOSUMDB=sum.golang.google.cn, the reachable mirror of sum.golang.org, checked with the same key), rustup, Bundler, RubyGems (GEMRC) and Maven (MAVEN_ARGS), all Aliyun. A value the user exported first wins, and root's shells skip it. cargo reads source replacement only from $CARGO_HOME/config.toml, so a marked block goes there, for the user who switches and the first user of a China install; it records what it added so World restores the file exactly, and a config that already configures crates.io, or that has been hand-edited, is left alone. Not covered: tools mise installs from GitHub releases, the AUR, the arch-mact2 hardware repository and Google services.

Preinstalls. A region can also change what a new install comes with, as data in its profile: apps-skip names launchers and preinstalled key bindings to leave out, and packages-skip and packages-add name packages to leave out of or add to the default set. The ISO applies the package lists while it installs the defaults, adding only what its offline mirror carries, so a package with no build for the machine never fails an install (omacom/omarchy-iso#275). For the first user of a regional install, omarchy-region-preinstalls removes the skipped launchers, unpins them from the dock, and records them in ~/.local/state/omarchy/preinstalls-skipped, which omarchy-refresh-applications and the preinstalled bindings (o.bind_preinstalled) read, so a refresh or migration does not bring them back. World has no lists and installs exactly the defaults. Preinstalls are decided once, at install: a region switch changes where packages come from, never which apps are installed, because removing apps on a switch would take away ones the user may still reach and installing them would add software nobody chose.

China adds WeChat (wechat-bin), QQ (linuxqq), WPS Office (wps-office-cn, x86_64 only), DingTalk (dingtalk-bin), Feishu (feishu-bin) and Maple Mono NF CN (maplemono-nf-cn).

Font. A profile's font names the monospace family its first user gets. China's is Maple Mono NF CN, which draws Han two cells wide, so Chinese lines up with Latin in a terminal. omarchy-region-preinstalls sets it with omarchy-font-set only when the font is installed. During an install there is no session, so OMARCHY_FONT_HEADLESS writes foot, alacritty, kitty, ghostty and fontconfig without restarting the shell, notifying, or signalling terminals that the chroot shares with the live system. The font is already current at first login, so #16026's one-time Maple invitation does not appear. World keeps JetBrains Mono. omarchy-font-set now replaces only the family in alacritty's font lines and keeps each style, and the keybinding extractor reads o.bind_preinstalled. It leaves out these, because their services are blocked or unreliable in mainland China without a VPN:

  • YouTube (launcher, dock pin, binding): Google, blocked.
  • X (launcher, dock pin, binding) and the X Post binding: blocked.
  • Discord (launcher): blocked.
  • WhatsApp (launcher, binding): Meta, blocked.
  • Google Contacts, Google Maps, Google Messages, Google Photos (launchers, and the bindings for Maps, Messages and Photos): Google, blocked.
  • ChatGPT (binding): blocked, and OpenAI does not serve China.
  • Grok (binding): xAI, blocked.
  • Signal (binding): blocked.
  • Music (binding, which opens Spotify): Spotify is not offered in China and is blocked.

Kept, as questions for the maintainer:

  • Basecamp, HEY (launchers and the Calendar and Email bindings) and Zoom: reachable as far as published measurements show, though not tested from inside China.
  • The 1Password binding: no evidence either way.
  • superwhisper: it dictates locally, but its cloud features may not work.
  • Tools that download from GitHub (mise, tldr, gh, the agent wrappers): GitHub is reachable but unreliable.
  • The agent CLIs whose services refuse China (claude, codex, copilot, cursor-agent, grok, antigravity-cli): these are lazy mise tools that only install on first use, not preinstalls. Should China leave them out too? Kimi, which works in China, stays.
  • Chinese web apps such as Bilibili or Weibo: none is packaged as a launcher today. Should China add them?

Switching. omarchy-region keeps the command-scoped sudo boundary: it renders as the caller, checks the region's first servers answer, applies the tool settings, then has root copy the two pacman files and rename the marker into place, last. Until the marker names the new region, any exit, including a closed terminal or Ctrl+C, puts the old region back; when a closed terminal leaves the rollback unable to authenticate, it says how to finish. It does not resync or upgrade packages.

Existing installs have no marker and stay World until switched. docs/regions.md covers the layout, the fallback rules and the trust model.

Related: #11456, #9695, #15118, #15119.

@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 2/5

[Medium impact] The changes affect package downloads, developer tools, and first-user setup for China-region machines.

The PR still needs fixes for ARM switching, overlapping rollback copies, and new apps keeping the previous region's registries.

Fix All in CodexFindings

  1. P1 China switch fails on ARM ▶
  2. P1 Overlapping switches restore wrong files ▶
  3. P1 New terminals keep China settings ▶
  4. P2 Edited cargo settings disappear ▶
  5. P2 Region is missing from help ▶
  6. P2 Required startup test is missing ▶
  7. P2 Bash comparisons break repository style ▶

Summary

Adds World and China defaults for package mirrors, developer-tool registries, and new-install apps.

  • World and China settings control which region Omarchy uses.
  • China machines try nearby package mirrors before the global servers.
  • China settings send developer tools to regional package registries.
  • China installs can start with selected apps skipped and Maple Mono set.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Region choice] --> B[Render package settings]
  B --> C[Check mirror access]
  C --> D[Apply developer-tool settings]
  D --> E[Copy package settings]
  E --> F[Write region marker last]
  G[China user setup] --> H[Remove skipped launchers and bindings]
  G --> I[Set installed regional font without session signals]
Loading

Reviews (11) · Last reviewed commit: "Signal no terminals when setting a font ..." · Reviewed by Greptile

Comment thread bin/omarchy-refresh-pacman Resolved
Comment thread bin/omarchy-channel-set Resolved
@axelfontaine

Copy link
Copy Markdown
Contributor

Regions are useful beyond China. 1Password for example uses different servers for global (US), Canada and EU. See https://support.1password.com/regions/

A unified ISO with region selection during install is probably to best choice to avoid overcomplicating things.

@xdanger

xdanger commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Regions are useful beyond China. 1Password for example uses different servers for global (US), Canada and EU. See https://support.1password.com/regions/

A unified ISO with region selection during install is probably to best choice to avoid overcomplicating things.

Thanks, good point. Regions aren't specific to China.

The trade-off is that every user would have to pick their region during install, even though most don't need a regional profile. A dedicated --region build keeps the default install exactly as it is today.

Both are reasonable, so leave this to @dhh.

@axelfontaine

Copy link
Copy Markdown
Contributor

@xdanger Region can be preselected on setup through auto-detection, just like the time zone.

@xdanger

xdanger commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@axelfontaine you are absolutely right! Will revert all the --region changes and try your plan.

Comment thread test/shell.d/region-pacman-test.sh Resolved
ZacharyZhang-NY added a commit to ZacharyZhang-NY/omarchy that referenced this pull request Oct 9, 2026
…or prepends

Drop the .cn servers.sed twins, the USTC Arch fallback and the closed
omacom#14399 timezone preselection. region.sh follows the installer's marker.
Raiden-MeixElysia pushed a commit to Raiden-MeixElysia/omarchy that referenced this pull request Oct 12, 2026
# Conflicts:
#	AGENTS.md
#	bin/omarchy-refresh-pacman
#	default/omarchy/omarchy-menu.jsonc
#	install/post-install/pacman.sh
#	shell/plugins/menu/MenuModel.js
#	test/shell.d/menu-test.sh
Raiden-MeixElysia pushed a commit to Raiden-MeixElysia/omarchy that referenced this pull request Oct 12, 2026
…y with a region

Integration only, until omarchy omacom#13690 rebases onto the ARM pacman
templates. pacman-templates-test still expects x86 refresh to copy
the templates directly.
Raiden-MeixElysia pushed a commit to Raiden-MeixElysia/omarchy that referenced this pull request Oct 12, 2026
Raiden-MeixElysia pushed a commit to Raiden-MeixElysia/omarchy that referenced this pull request Oct 12, 2026
# Conflicts:
#	AGENTS.md
#	bin/omarchy-refresh-pacman
#	default/omarchy/omarchy-menu.jsonc
#	install/post-install/pacman.sh
#	shell/plugins/menu/MenuModel.js
#	test/shell.d/menu-test.sh
Raiden-MeixElysia pushed a commit to Raiden-MeixElysia/omarchy that referenced this pull request Oct 12, 2026
…y with a region

Integration only, until omarchy omacom#13690 rebases onto the ARM pacman
templates. pacman-templates-test still expects x86 refresh to copy
the templates directly.
Raiden-MeixElysia pushed a commit to Raiden-MeixElysia/omarchy that referenced this pull request Oct 12, 2026
Comment thread bin/omarchy-region
Comment on lines +78 to +79
arch_server=$(sed -n '1s/^Server = //p' "$work/rendered/mirrorlist")
for url in "${omarchy_server//\$arch/$arch}/omarchy.db" "$(sed "s|\$repo|core|; s|\$arch|$arch|" <<<"$arch_server")/core.db"; do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 China switch fails on ARM

On both ARM platforms, the mirrorlist starts with comments. This reads line 1 as a server URL, so curl receives a comment followed by /core.db and fails. Users cannot switch to China, including its developer-tool mirrors.

Read the first Server = entry rather than the first line.

Fix in Codex Fix in Claude Code

Comment thread bin/omarchy-region
Comment on lines +87 to +92
sudo cp -f /etc/pacman.conf /etc/pacman.conf.bak
sudo cp -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
changed=1
omarchy-region-user "$region"
sudo cp -f "$work/rendered/pacman.conf" /etc/pacman.conf
sudo cp -f "$work/rendered/mirrorlist" /etc/pacman.d/mirrorlist

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Overlapping switches restore wrong files

Each switch overwrites the same rollback files. One switch can copy China's pacman.conf and pause; a second switch can then back up that half-switched state. If the first switch fails, restore_previous restores those newer backups, leaving the old region marker with mixed package settings. omarchy-refresh-pacman also writes the same backups.

Hold a shared lock from reading the current state through completion or rollback, and keep each switch's rollback copies separate.

Fix in Codex Fix in Claude Code

@omarchybot omarchybot changed the title Add region profiles, starting with China's package repositories Add a World / China region for package mirrors and developer tool registries Oct 15, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and extended on the maintainer's direction, and verified on a fresh Omarchy worker against the merge with current quattro. I pushed five commits on top of yours, @xdanger, and rewrote the description to match.

What changed, and why:

  • [archlinuxcn] and its keyring are gone. Nothing installed or updated needs them, and pacman trusts a populated keyring for every repository, so those packagers' keys could have signed packages for [core] and [omarchy] on China machines. It is also a rolling repository against stable and rc snapshots. The profile now only puts Omarchy's China replicas first, and adds pkgs.omarchy.cn/<channel> ahead of pkgs.omarchy.org in [omarchy].
  • Setup > Region > World / China and omarchy-region. The idea comes from Switch the region under Setup > Region, and offer China Apps #15119. The switcher is rebuilt on the bash -p sudo boundary: it renders as the caller and has root copy the files, with the marker renamed into place last. Any failure or interruption rolls back.
  • Developer tool registries for China. These come from Point package managers at China mirrors on cn installs #15118, with its defects fixed:
    • Go gets GOSUMDB=sum.golang.google.cn.
    • Maven's settings come through OMARCHY_PATH.
    • cargo gets a marked block in $CARGO_HOME/config.toml, the only place cargo install reads.
    • Nothing overwrites a value or config the user set.
  • Hong Kong, Macau and Taiwan never resolve to a region. A test pins this under every tzdata name.

Checked on the worker:

  • The region shell tests pass, and so do the channel, menu, guard and dev-env tests. Reverting each fix made its test fail.
  • A live China → World switch on a real system:
    • pacman -Sy fetched from mirror.omarchy.cn and pkgs.omarchy.cn.
    • From a new login shell, npm, pip, Go, rustup, Bundler, gem and Maven pointed at the China registries.
    • cargo fetch and go get downloaded through them, and the session's systemd environment was updated.
    • World reverted all of it, with both pacman files byte-identical to the edge templates.
  • Timezone → region → pacman files. Shanghai, Urumqi, PRC, Chongqing and Kashgar render China. Hong Kong, Hongkong, Macau, Taipei, ROC, Copenhagen and UTC render the templates byte for byte.
  • The full shell suite: 6329 passed and 3 failed. All three also fail on quattro: two background tests, and the i18n catalog check waiting on translations of new strings.

Second opinion: Codex at medium effort, three rounds.

  • Round 1 found six defects, all fixed:
    • root login shells sourcing a dev checkout's environment file;
    • interrupted switches skipping the rollback;
    • a marker written in place;
    • cargo files not restored byte for byte;
    • a crates.io table missed when spelled differently;
    • session variables clobbered.
  • Round 2 found six more, all fixed: a closed terminal unable to authenticate the rollback, a hangup between the marker and the commit, and four cargo edge cases.
  • Round 3 had nothing left to block on.

This is waiting on the maintainer. omacom/omarchy-iso#241 is its install-time half.

omarchybot and others added 2 commits October 20, 2026 16:56
A region profile can name launchers and preinstalled bindings to leave out (apps-skip) and packages to skip or add (packages-skip, packages-add), keyed off the region the install already records. The installer applies the package lists; omarchy-region-preinstalls removes the skipped launchers and dock pins for the user a regional install finalizes and records them, so launcher refreshes and the bindings keep them out and a later region switch changes no apps.

China leaves out the apps whose services are unreachable there without a VPN and adds WeChat, QQ, WPS Office, DingTalk and Feishu.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ges-skip can do

An empty XDG_STATE_HOME is unset to the shell side, so the bindings now fall back to ~/.local/state as well. packages-skip leaves packages out of the default set only; one the installer or another package needs still installs, and the docs say so. The test keeps every command's state under its own home.

Co-Authored-By: Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Added region preinstalls (cf6826b, 2bcee54). A profile can now leave out launchers, dock pins and preinstalled bindings (apps-skip) and leave out or add packages (packages-skip, packages-add), keyed off /etc/omarchy/region. The ISO side is omacom/omarchy-iso#275. China leaves out YouTube, X, Discord, WhatsApp, four Google apps, ChatGPT, Grok, Signal and Spotify, and adds WeChat, QQ, WPS Office, DingTalk and Feishu. World is unchanged, and a later region switch adds or removes no apps. On a worker, a China user ended with no YouTube or X launchers, pins or bindings, and a World user kept them all. region-preinstalls-test.sh is new, and the region, dock, preinstall and Hyprland binding suites pass. Codex Medium reviewed it: two of its four findings were fixed (the bindings ignoring an empty XDG_STATE_HOME, and test isolation), the other two are addressed in the docs and the ISO's builder test, and a follow-up pass found nothing; its agreement is not guaranteed to be independent. The body lists every removal with its reason, plus open questions (the agent CLIs, GitHub-based tools, Bilibili and Weibo). Merging is the maintainer's call.

quattro's Calculator bindings go through o.bind_preinstalled like the other preinstalled bindings. Refresh keeps quattro's current-channel detection and the branch's regional render, so the boundary tests from quattro now check the render's copies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Brought up to date with quattro (54fcdbc), merged with no force-push. Three conflicts were resolved: quattro's Calculator bindings now use o.bind_preinstalled like the other preinstalled bindings; the menu's guard readers keep both omarchy-region-current and quattro's new entries; and pacman-templates-test.sh keeps quattro's current-channel tests, now checking the regional render's copies, since refresh keeps quattro's channel detection and this branch's render. The region, channel, pacman-template, preinstall, dock, menu and Hyprland binding suites pass on a worker.

Comment thread bin/omarchy-region-user
Comment on lines +102 to +103
(( ${#unset_names[@]} == 0 )) || systemctl --user unset-environment "${unset_names[@]}"
(( ${#set_values[@]} == 0 )) || systemctl --user set-environment "${set_values[@]}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 New terminals keep China settings

Switching from China to World updates only systemd's environment. Apps launched through uwsm-app keep the environment of Hyprland or the running shell, so new terminals still inherit China's registry values. env-bootstrap does not clear those inherited values for World.

Update Hyprland's environment and restart the shell from it, as omarchy-language does.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex Fix in Claude Code

Comment thread bin/omarchy-region-user
Comment on lines +38 to +43
if len(begins) != 1 or len(ends) != 1 or ends[0] < begins[0] or mode not in MODES or ends[0] == len(lines) - 1:
leave("its omarchy region block has been edited")
# before is everything ahead of the newline that precedes BEGIN; after
# is everything following END's newline.
before = b"\n".join(lines[:begins[0]])
after = b"\n".join(lines[ends[0] + 1:])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Edited cargo settings disappear

The cargo check detects edited markers, but not edits inside the marked block. If a user changes the registry URL or adds a setting inside that block, switching to World deletes those edits; reapplying China overwrites them. This conflicts with the stated promise to leave hand-edited configurations alone.

Check the block's contents before replacing or removing it.

Fix in Codex Fix in Claude Code

Comment thread bin/omarchy-region
Comment on lines +3 to +5
# omarchy:summary=Set where packages and developer tools download from: world or china
# omarchy:args=<world|china>
# omarchy:examples=omarchy region china | omarchy region world

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Region is missing from help

The new public region command group has no entry in GROUP_DESCRIPTIONS. AGENTS.md requires adding that entry for a group users should browse. Without it, the top-level omarchy listing does not show the new group.

Add the entry before merging to satisfy the repository requirement.

File Used: AGENTS.md (source)

Fix in Codex Fix in Claude Code

Comment thread bin/omarchy-region
@@ -0,0 +1,102 @@
#!/bin/bash -p

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Required startup test is missing

The new #!/bin/bash -p entrypoint has no regression test that launches it through ordinary Bash with a decoy -p argument. AGENTS.md requires that test for this shebang exception.

Add omarchy-region to the startup-refusal coverage before merging. The existing loop tests only the updater, pacman refresh, and sudo wrapper.

File Used: AGENTS.md (source)

Fix in Codex Fix in Claude Code

Comment thread bin/omarchy-region
local status=$?
# Reapplying the current region leaves the marker as it was, so there only
# reaching the end counts.
if (( changed && ! finished )) && [[ $previous == "$region" || $(omarchy-region-current) != "$target" ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Bash comparisons break repository style

The new Bash code uses bare comparison literals and quoted variables inside [[ ]], contrary to AGENTS.md: leave variables unquoted there and quote string literals. For example, use [[ $region == "cn" ]] and [[ $previous == $region ]].

The same pattern appears in omarchy-apply-pacman and omarchy-region-user. Update these comparisons before merging to satisfy the repository requirement.

File Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex Fix in Claude Code

omarchybot and others added 2 commits October 20, 2026 17:31
A region profile can name a font; omarchy-region-preinstalls sets it for the user a regional install finalizes, only when the install carries it, and without restarting a shell an install does not have (OMARCHY_FONT_HEADLESS). China names Maple Mono NF CN and adds maplemono-nf-cn, so the font is already current when the first-run invitation to Maple would otherwise appear.

omarchy-font-set now replaces only the family in alacritty's font lines, keeping each style, and the keybinding extractor reads o.bind_preinstalled, which the English keybindings catalog check needs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An install's chroot shares the live system's processes, so kitty and ghostty are signalled only in a live session. The test records the signals and covers first-boot owner setup.

Co-Authored-By: Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

A China install now makes Maple Mono NF CN the first user's monospace font (e9050b4, d862446). cn gains a font file and adds maplemono-nf-cn, which is published on every channel. omarchy-region-preinstalls sets the font only when it is installed, headless, with no shell restart, notification or terminal signal. On a worker with the real package, a China user ended with Maple in foot, alacritty, kitty and fontconfig (fc-match monospace), and #16026's invitation stayed silent; a World user kept JetBrains Mono. Along the way, omarchy-font-set now keeps alacritty's styles, and the keybinding extractor reads o.bind_preinstalled, which was what failed i18n-check here. Codex Medium reviewed it: its finding that headless runs still signalled kitty and ghostty is fixed, and a follow-up found nothing more; its agreement is not guaranteed to be independent.

@emirb

emirb commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@xdanger This is a lot to review as one PR so I will split it out into smaller parts while preserving your commits.

emirb added a commit that referenced this pull request Oct 22, 2026
Many registries developer tools pull from are slow or unreachable from
mainland China. With the region marker set to cn, env-bootstrap exports
the profile's environment to every shell and the desktop session: npm,
pip and uv, Go (with GOSUMDB=sum.golang.google.cn, sum.golang.org's
reachable mirror, checked with the same key), rustup, Bundler, RubyGems
and Maven. A value the user exported first wins, and root's shells skip
it, since a dev link's OMARCHY_PATH is a user-writable checkout.

cargo reads source replacement only from $CARGO_HOME/config.toml, so
omarchy-region-user adds a marked block there for the first user of a
China install and removes exactly that block for World. A config that
already sets crates.io's source, invalid TOML, and a block edited
around or inside its markers are left alone.

From #13690 by @xdanger, where omarchybot wrote this part; updating a
running session's environment is left to region switching, which
needs it.

Co-authored-by: Kros Dai <[email protected]>
emirb added a commit that referenced this pull request Oct 22, 2026
Many registries developer tools pull from are slow or unreachable from
mainland China. With the region marker set to cn, env-bootstrap exports
the profile's environment to every shell and the desktop session: npm,
pip and uv, Go (with GOSUMDB=sum.golang.google.cn, sum.golang.org's
reachable mirror, checked with the same key), rustup, Bundler, RubyGems
and Maven. A value the user exported first wins, and root's shells skip
it, since a dev link's OMARCHY_PATH is a user-writable checkout.

cargo reads source replacement only from $CARGO_HOME/config.toml, so
omarchy-region-user adds a marked block there for the first user of a
China install and removes exactly that block for World. A config that
already sets crates.io's source, invalid TOML, and a block edited
around or inside its markers are left alone.

From #13690 by @xdanger, where omarchybot carried over
@Raiden-MeixElysia's registries from #15118; updating a running
session's environment is left to region switching, which needs it.

Co-authored-by: Kros Dai <[email protected]>
Co-authored-by: 雷电芽衣 <[email protected]>
emirb added a commit that referenced this pull request Oct 22, 2026
Many registries developer tools pull from are slow or unreachable from
mainland China. With the region marker set to cn, env-bootstrap exports
the profile's environment to every shell and the desktop session: npm,
pip and uv, Go (with GOSUMDB=sum.golang.google.cn, sum.golang.org's
reachable mirror, checked with the same key), rustup, Bundler, RubyGems
and Maven. A value the user exported first wins, and root's shells skip
it, since a dev link's OMARCHY_PATH is a user-writable checkout.

cargo reads source replacement only from $CARGO_HOME/config.toml, so
omarchy-region-user adds a marked block there for the first user of a
China install and removes exactly that block for World. A config that
already sets crates.io's source, invalid TOML, and a block edited
around or inside its markers are left alone.

From #13690 by @xdanger, where omarchybot carried over
@Raiden-MeixElysia's registries from #15118; updating a running
session's environment is left to region switching, which needs it.

Co-authored-by: Kros Dai <[email protected]>
Co-authored-by: 雷电芽衣 <[email protected]>
emirb added a commit that referenced this pull request Oct 22, 2026
Setup > Region offers World and China, and `omarchy region world|china`
does the same from a terminal; `omarchy region current` prints the
active one. A switch renders both pacman files as the caller, checks
that the region's first servers answer, applies the developer tool
settings, has root copy the two files, and moves the marker into place
last. Until the marker names the new region, any failure, a closed
terminal or Ctrl+C puts the old region back.

Beyond the version in #13690:

- The probe reads the first Server line of the mirrorlist. ARM
  mirrorlists open with comments, so it used to ask for /core.db and
  refuse every switch on ARM. It names the architecture through
  omarchy-hw-aarch64, not uname.
- One switch runs at a time, for every user: it locks /etc/pacman.conf,
  which any user can open. A second one started while the first waited
  for its password would back up a half-switched machine as the region
  to return to.
- A shell started after a switch to World drops the registries China
  set for the running session (OMARCHY_REGION_EXPORTED) while they still
  hold China's values, and none the user set, so new terminals follow at
  once; apps started straight from the desktop follow at the next login,
  and the switch says so.
- omarchy-region-current and env-bootstrap read a marker without a
  final newline.
- The region command group has its description, and omarchy-region
  joins the bash -p startup refusal test.

From #13690 by @xdanger, where omarchybot carried over
@Raiden-MeixElysia's Setup > Region from #15119.

Co-authored-by: Kros Dai <[email protected]>
Co-authored-by: 雷电芽衣 <[email protected]>
emirb added a commit that referenced this pull request Oct 22, 2026
Setup > Region offers World and China, and `omarchy region world|china`
does the same from a terminal; `omarchy region current` prints the
active one. A switch renders both pacman files as the caller, checks
that the region's first servers answer, applies the developer tool
settings, has root copy the two files, and moves the marker into place
last. Until the marker names the new region, any failure, a closed
terminal or Ctrl+C puts the old region back.

Beyond the version in #13690:

- The probe reads the first Server line of the mirrorlist. ARM
  mirrorlists open with comments, so it used to ask for /core.db and
  refuse every switch on ARM. It names the architecture through
  omarchy-hw-aarch64, not uname.
- One writer of pacman's files at a time, for every user: the switch
  locks /etc/pacman.conf, which any user can open, and
  omarchy-refresh-pacman takes the same lock. A second switch or a
  refresh started while the first waited for its password would replace
  the backups it returns to.
- A failed switch puts the user's own cargo config back exactly as it
  was, rather than reapplying the old region, which could add a China
  block that user never had.
- A shell started after a switch to World drops the registries China
  set for the running session (OMARCHY_REGION_EXPORTED) while they still
  hold China's values, and none the user set, so new terminals follow at
  once; apps started straight from the desktop follow at the next login,
  and the switch says so. Root's shells never take part, taking back
  included, since a dev link's checkout is user-writable.
- omarchy-region-current and env-bootstrap read a marker without a
  final newline.
- The region command group has its description, and omarchy-region
  joins the bash -p startup refusal test.

From #13690 by @xdanger, where omarchybot carried over
@Raiden-MeixElysia's Setup > Region from #15119.

Co-authored-by: Kros Dai <[email protected]>
Co-authored-by: 雷电芽衣 <[email protected]>
emirb added a commit that referenced this pull request Oct 22, 2026
Setup > Region offers World and China, and `omarchy region world|china`
does the same from a terminal; `omarchy region current` prints the
active one. A switch renders both pacman files as the caller, checks
that the region's first servers answer, applies the developer tool
settings, has root copy the two files, and moves the marker into place
last. Until the marker names the new region, any failure, a closed
terminal or Ctrl+C puts the old region back.

Beyond the version in #13690:

- The probe reads the first Server line of the mirrorlist. ARM
  mirrorlists open with comments, so it used to ask for /core.db and
  refuse every switch on ARM. It names the architecture through
  omarchy-hw-aarch64, not uname.
- One writer of pacman's files at a time, for every user: the switch
  locks /etc/pacman.d, which any user can open and nothing replaces, and
  omarchy-refresh-pacman takes the same lock. A second switch or a
  refresh started while the first waited for its password would replace
  the backups it returns to.
- A failed switch puts the user's own cargo config back exactly as it
  was, rather than reapplying the old region, which could add a China
  block that user never had.
- A shell started after a switch to World drops the registries China
  set for the running session (OMARCHY_REGION_EXPORTED) while they still
  hold China's values, and none the user set, so new terminals follow at
  once; apps started straight from the desktop follow at the next login,
  and the switch says so. Root's shells never take part, taking back
  included, since a dev link's checkout is user-writable.
- omarchy-region-current and env-bootstrap read a marker without a
  final newline.
- The region command group has its description, and omarchy-region
  joins the bash -p startup refusal test.

From #13690 by @xdanger, where omarchybot carried over
@Raiden-MeixElysia's Setup > Region from #15119.

Co-authored-by: Kros Dai <[email protected]>
Co-authored-by: 雷电芽衣 <[email protected]>
@xdanger

xdanger commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Closing this umbrella PR in favour of focused successors, following the split proposed in #13690 (comment). This is supersession, not a claim that all of its features have merged.

The remaining runtime work is now tracked separately against current quattro:

Scope Replacement
Package mirrors, profile timezones and regional pacman rendering #16256, already merged
Developer-tool registries and their install-time user setup #16257, remains open and unchanged
Region switching, current-region command and Setup menu #16259, remains open and unchanged
Alacritty family replacement without stripping styles #17119
Regional app profiles, launcher/dock/binding exclusions, refresh persistence and explicit restore #17121
Installed regional default fonts and headless font configuration #17120; merge after #17119

I checked the original head d862446b2 against current quattro and the successor diffs. The app/font successors retain Omarchybot's author attribution and the original co-authors, preserve all 13 China exclusions and all six package requirements, and adapt the setup hooks and regression coverage to the current runtime rather than replaying stale merged code. The old combined preinstall test is covered in the existing app and font suites; the keybinding extractor understands o.bind_preinstalled without reverting newer i18n test changes. No mirror, registry or switching implementation is duplicated in the three new PRs.

Package delivery remains explicitly deferred. In #17121, packages-add is a declarative list, not an installer. No upstream runtime or ISO consumer installs it automatically; WPS Office's package is x86_64-only. The application packaging/installation work from unmerged omacom/omarchy-iso#275 has not landed. A China-specific ISO preset is not part of these successors. Generic timezone-to-region marker delivery remains in omacom/omarchy-iso#241; its scope has not been expanded to package installation. #17120 selects Maple only if the exact family is already installed, and otherwise leaves settings unchanged.

All three new PRs are ready for review, not merged. Focused regression checks pass, including isolated setup with a read-only host filesystem. Full-suite runs and their three independently reproduced upstream/environment failures are disclosed in the PRs. No existing branch or old worktree has been rewritten or removed.

@xdanger xdanger closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants