From 664fb7c51a6b8ad2f65f23e25121a5799c182602 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 24 Aug 2025 17:20:13 +0200 Subject: [PATCH] Separate pacman setup from aur and make aur optional --- install.sh | 1 + install/preflight/aur.sh | 32 ++++++++++++-------------------- install/preflight/pacman.sh | 9 +++++++++ 3 files changed, 22 insertions(+), 20 deletions(-) create mode 100644 install/preflight/pacman.sh diff --git a/install.sh b/install.sh index f67a3452..5384d77a 100755 --- a/install.sh +++ b/install.sh @@ -23,6 +23,7 @@ source $OMARCHY_INSTALL/preflight/trap-errors.sh source $OMARCHY_INSTALL/preflight/chroot.sh source $OMARCHY_INSTALL/preflight/mirrorlist.sh source $OMARCHY_INSTALL/preflight/guard.sh +source $OMARCHY_INSTALL/preflight/pacman.sh source $OMARCHY_INSTALL/preflight/aur.sh source $OMARCHY_INSTALL/preflight/migrations.sh diff --git a/install/preflight/aur.sh b/install/preflight/aur.sh index a7fd85ae..8f61c7a4 100644 --- a/install/preflight/aur.sh +++ b/install/preflight/aur.sh @@ -3,9 +3,6 @@ # Install build tools sudo pacman -Sy --needed --noconfirm base-devel jq -# Ensure package repositories are accessible before proceeding -omarchy-pkg-repos-accessible - # Only add Chaotic-AUR if the architecture is x86_64 so ARM users can build the packages if [[ "$(uname -m)" == "x86_64" ]] && [ -z "$DISABLE_CHAOTIC" ] && ! command -v yay &>/dev/null; then # Try installing Chaotic-AUR keyring and mirrorlist @@ -25,21 +22,16 @@ if [[ "$(uname -m)" == "x86_64" ]] && [ -z "$DISABLE_CHAOTIC" ] && ! command -v else echo "Failed to install Chaotic-AUR, so won't include it in pacman config!" fi -fi - -# Manually install yay from AUR if not already available -if ! command -v yay &>/dev/null; then - cd /tmp - rm -rf yay-bin - git clone https://aur.archlinux.org/yay-bin.git - cd yay-bin - makepkg -si --noconfirm - cd - - rm -rf yay-bin - cd ~ -fi - -# Add fun and color and verbosity to the pacman installer -if ! grep -q "ILoveCandy" /etc/pacman.conf; then - sudo sed -i '/^\[options\]/a Color\nILoveCandy\nVerbosePkgLists' /etc/pacman.conf +else + # Manually install yay from AUR if not already available + if ! command -v yay &>/dev/null; then + cd /tmp + rm -rf yay-bin + git clone https://aur.archlinux.org/yay-bin.git + cd yay-bin + makepkg -si --noconfirm + cd - + rm -rf yay-bin + cd ~ + fi fi diff --git a/install/preflight/pacman.sh b/install/preflight/pacman.sh new file mode 100644 index 00000000..618e4f3e --- /dev/null +++ b/install/preflight/pacman.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Install build tools +sudo pacman -Sy --needed --noconfirm base-devel jq + +# Add fun and color and verbosity to the pacman installer +if ! grep -q "ILoveCandy" /etc/pacman.conf; then + sudo sed -i '/^\[options\]/a Color\nILoveCandy\nVerbosePkgLists' /etc/pacman.conf +fi