Files
omarchy-pkgs/pkgbuilds/omarchy-settings-dev/omarchy-settings-dev.install
T
Marcelo Alcantara 4ed5f14629 Build the omarchy package pair for aarch64
The Omarchy payload is architecture-independent, but the package is not.
On x86_64 omarchy pulls the Limine + mkinitcpio hook + Snapper boot stack;
on Apple Silicon the system boots through m1n1 + GRUB from the Asahi
packages on Arch Linux ARM's kernel, so that stack does not apply, and
Wi-Fi on the Broadcom parts needs the iwd backend. The shipped /etc tree
differs too: mkinitcpio reads every file under /etc/mkinitcpio.conf.d/,
so shipping omarchy_hooks.conf on aarch64 injects the Limine hooks into
the Asahi kernel's initramfs, and the zram/zswap/oomd drop-ins and the
zram-tuned vm.* sysctls belong to the x86_64 memory stack.

makepkg only honours depends_<arch> and optdepends_<arch> on
arch-specific packages, so arch=('any') becomes ('x86_64' 'aarch64').
backup=() has no arch-suffixed form, so the x86_64-only entries are
appended under CARCH and each of those paths is removed from the aarch64
package in package(). The x86_64 package keeps exactly the contents it
had; only its filename suffix changes.

The install scriptlet applies the hardened cups-files.conf on every
platform, then on Apple Silicon keeps the Arch Linux ARM system identity
(/etc/os-release stays the distribution's symlink) instead of the
etc-overrides. The -dev pair carries the same change so the pairs stay in
lockstep.
2026-09-02 21:59:45 +10:00

65 lines
2.9 KiB
Plaintext

_apple_silicon() {
[[ $(uname -m) == aarch64 ]] && grep -aq 'apple,' /proc/device-tree/compatible 2>/dev/null
}
_etc_overrides_apply() {
echo "Applying Omarchy etc-overrides..."
# The hardened CUPS authorization applies on every platform. It waits for the
# file the cups package owns: an ISO bootstrap without cups installed is left
# alone and picks it up once cups lands.
if [[ -f /etc/cups/cups-files.conf && -f /usr/share/omarchy/etc-overrides/cups-cups-files.conf ]]; then
systemd-sysusers /etc/sysusers.d/omarchy-cups-browsed.conf
install -m 0640 -o root -g cups /usr/share/omarchy/etc-overrides/cups-cups-files.conf /etc/cups/cups-files.conf
fi
# Apple Silicon installs run on Arch Linux ARM's base with the Asahi
# packages, and keep that system identity: /etc/os-release stays the
# symlink to the distribution's /usr/lib/os-release, and the PAM, NSS,
# plymouth and skel overrides below are not applied there.
if _apple_silicon; then
echo "Preserving Arch Linux ARM system configuration on Apple Silicon..."
if [[ -f /usr/lib/os-release ]]; then
rm -f /etc/os-release
ln -s ../usr/lib/os-release /etc/os-release
fi
return 0
fi
# Ensure parent dirs exist. cups-browsed may not be installed yet during ISO
# bootstrap; do not create /etc/cups/cups-browsed.conf before the package is
# installed or pacman will preserve its packaged file as a noisy .pacnew.
install -d /etc/plymouth /etc/security /etc/skel
# NOTE: these cp -f's are intentionally destructive on every install/upgrade.
# Users who customize /etc/os-release, /etc/plymouth/plymouthd.conf (theme
# switch), /etc/cups/cups-browsed.conf, /etc/cups/cups-files.conf, /etc/nsswitch.conf,
# /etc/security/faillock.conf, or /etc/skel/.bashrc WILL have their changes
# reset to Omarchy defaults each time omarchy-settings-dev is upgraded. This is
# the trade-off of routing upstream-owned paths through etc-overrides instead
# of pacman backup=().
rm -f /etc/os-release
cp -f /usr/share/omarchy/etc-overrides/os-release /etc/os-release
cp -f /usr/share/omarchy/etc-overrides/security-faillock.conf /etc/security/faillock.conf
cp -f /usr/share/omarchy/etc-overrides/nsswitch.conf /etc/nsswitch.conf
if [[ -f /etc/cups/cups-browsed.conf ]]; then
install -d /etc/cups
cp -f /usr/share/omarchy/etc-overrides/cups-cups-browsed.conf /etc/cups/cups-browsed.conf
fi
cp -f /usr/share/omarchy/etc-overrides/plymouth-plymouthd.conf /etc/plymouth/plymouthd.conf
cp -f /usr/share/omarchy/etc-overrides/dot.bashrc /etc/skel/.bashrc
chmod 0644 /etc/os-release /etc/security/faillock.conf /etc/nsswitch.conf \
/etc/plymouth/plymouthd.conf /etc/skel/.bashrc
if [[ -f /etc/cups/cups-browsed.conf ]]; then
chmod 0644 /etc/cups/cups-browsed.conf
fi
}
post_install() {
_etc_overrides_apply
}
post_upgrade() {
_etc_overrides_apply
}