Point npm, PyPI, Go, Rust, RubyGems and Maven at China mirrors on China machines

This commit is contained in:
ZacharyZhang-NY committed 2026-10-06 00:28:00 -04:00
1 parent da6045be3f
commit 151a530d15
7 files changed
+75 -5

No files matched your search

+21
View File
@@ -1,10 +1,31 @@
china_links=(
"environment.conf /etc/environment.d/90-omarchy-china.conf"
"cargo.toml /.cargo/config.toml"
"gemrc /etc/gemrc"
)
case ${OMARCHY_REGION:-global} in
global)
rm -f /etc/omarchy/region
for link in "${china_links[@]}"; do
read -r _ target <<<"$link"
if [[ -L $target && $(readlink "$target") == */default/region/china/* ]]; then
rm "$target"
fi
done
;;
china)
mkdir -p /etc/omarchy
echo china >/etc/omarchy/region
for link in "${china_links[@]}"; do
read -r source target <<<"$link"
if [[ -e $target && ! -L $target ]]; then
echo "Refusing to replace $target, which Omarchy did not create" >&2
exit 1
fi
mkdir -p "${target%/*}"
ln -sfn "$OMARCHY_PATH/default/region/china/$source" "$target"
done
omarchy-pkg-add fcitx5-configtool fcitx5-rime librime opencc rime-ice-installer
;;
*)