diff options
| author | tranch <tranch.xiao@gmail.com> | 2026-07-09 16:53:52 +0800 |
|---|---|---|
| committer | tranch <tranch.xiao@gmail.com> | 2026-07-09 17:01:14 +0800 |
| commit | ed40e44b610cac878f17fa4233d8e3d19b8d67bb (patch) | |
| tree | 206f40fb94055c71e2d361ba68920a2aa9aab6de /system_files/etc | |
| parent | 4a99dd73617e0cd5784929b5007a0aa5e92c7dd5 (diff) | |
| download | AeroCore-OS-ed40e44b610cac878f17fa4233d8e3d19b8d67bb.tar.gz AeroCore-OS-ed40e44b610cac878f17fa4233d8e3d19b8d67bb.zip | |
Configure AeroCore image mirrors
Add build-time mirror configuration for Flatpak and Homebrew, expose the related build args, and install an AeroCore-owned profile script to load mirror environment files. Rename the mirror configuration files from the Bazzite-prefixed names to AeroCore-prefixed names while keeping the upstream Bazzite helper reference intact.
Verification: bash -n system_files/etc/profile.d/aerocore-mirrors.sh && bash -n build_files/build.sh
Diffstat (limited to 'system_files/etc')
| -rw-r--r-- | system_files/etc/profile.d/aerocore-mirrors.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/system_files/etc/profile.d/aerocore-mirrors.sh b/system_files/etc/profile.d/aerocore-mirrors.sh new file mode 100644 index 0000000..e9b93ab --- /dev/null +++ b/system_files/etc/profile.d/aerocore-mirrors.sh @@ -0,0 +1,28 @@ +#!/usr/bin/bash + +[[ -r /usr/libexec/bazzite-mirror-utils.sh ]] && source /usr/libexec/bazzite-mirror-utils.sh + +if ! declare -F is_valid_mirror_url >/dev/null; then + is_valid_mirror_url() { + [[ "$1" =~ ^https?://[^[:space:]]+$ ]] + } +fi + +load_mirror_file() { + local file="$1" + [[ -r "$file" ]] || return + + while IFS='=' read -r key value; do + [[ -z "$key" || "${key:0:1}" == "#" ]] && continue + case "$key" in + FLATPAK_REMOTE_URL|HOMEBREW_BOTTLE_DOMAIN|HOMEBREW_API_DOMAIN) + if is_valid_mirror_url "$value"; then + export "$key"="$value" + fi + ;; + esac +done <"$file" +} + +load_mirror_file /etc/environment.d/99-aerocore-mirrors.conf +load_mirror_file "$HOME/.config/environment.d/99-aerocore-mirrors.conf" |
