Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions pkgbuilds/omarchy-settings-dev/omarchy-settings-dev.install
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,6 @@ _etc_overrides_apply() {
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.
Expand All @@ -103,8 +90,21 @@ _etc_overrides_apply() {
# 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
#
# Apple Silicon installs run on Arch Linux ARM's base with the Asahi packages
# and keep that system identity, which Asahi's tooling reports: /etc/os-release
# stays the symlink to the distribution's /usr/lib/os-release there. Every
# other override applies on Apple Silicon as everywhere else.
if _apple_silicon; then
if [[ -f /usr/lib/os-release ]]; then
rm -f /etc/os-release
ln -s ../usr/lib/os-release /etc/os-release
fi
else
rm -f /etc/os-release
cp -f /usr/share/omarchy/etc-overrides/os-release /etc/os-release
chmod 0644 /etc/os-release
fi
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
Expand All @@ -113,7 +113,7 @@ _etc_overrides_apply() {
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 \
chmod 0644 /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
Expand Down
32 changes: 16 additions & 16 deletions pkgbuilds/omarchy-settings/omarchy-settings.install
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,6 @@ _etc_overrides_apply() {
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.
Expand All @@ -103,8 +90,21 @@ _etc_overrides_apply() {
# reset to Omarchy defaults each time omarchy-settings 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
#
# Apple Silicon installs run on Arch Linux ARM's base with the Asahi packages
# and keep that system identity, which Asahi's tooling reports: /etc/os-release
# stays the symlink to the distribution's /usr/lib/os-release there. Every
# other override applies on Apple Silicon as everywhere else.
if _apple_silicon; then
if [[ -f /usr/lib/os-release ]]; then
rm -f /etc/os-release
ln -s ../usr/lib/os-release /etc/os-release
fi
else
rm -f /etc/os-release
cp -f /usr/share/omarchy/etc-overrides/os-release /etc/os-release
chmod 0644 /etc/os-release
fi
Comment on lines +98 to +107

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Mac override coverage is missing

The existing lifecycle test replaces _etc_overrides_apply() with a no-op, so it cannot catch the Mac early return coming back. Keep the fake-root check as a regression test for both settings packages. Cover both platform branches, file permissions, and cups-browsed.conf present and absent.

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!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added in #1927: tests/settings-etc-overrides.sh runs both packages' real _etc_overrides_apply against a scratch root, on both platforms, with cups-browsed present and absent, and checks contents and modes. It fails against the pre-#1857 script.

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
Expand All @@ -113,7 +113,7 @@ _etc_overrides_apply() {
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 \
chmod 0644 /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
Expand Down
Loading