diff --git a/install.sh b/install.sh index cefa8501..3a2a8066 100755 --- a/install.sh +++ b/install.sh @@ -12,8 +12,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/repositories.sh source $OMARCHY_INSTALL/preflight/migrations.sh # Configuration diff --git a/install/preflight/pacman.sh b/install/preflight/pacman.sh deleted file mode 100644 index 3c94f294..00000000 --- a/install/preflight/pacman.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/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 - -# Add the Omarchy repository first -if ! grep -q "omarchy" /etc/pacman.conf; then - sudo sed -i '/^\[core\]/i [omarchy]\nSigLevel = Optional TrustAll\nServer = https:\/\/pkgs.omarchy.org\/$arch\/\n' /etc/pacman.conf -fi diff --git a/install/preflight/aur.sh b/install/preflight/repositories.sh similarity index 62% rename from install/preflight/aur.sh rename to install/preflight/repositories.sh index 33767c16..9ed86b72 100644 --- a/install/preflight/aur.sh +++ b/install/preflight/repositories.sh @@ -1,5 +1,21 @@ #!/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 + +# Add the Omarchy repository as first choice +if ! grep -q "omarchy" /etc/pacman.conf; then + sudo sed -i '/^\[core\]/i [omarchy]\nSigLevel = Optional TrustAll\nServer = https:\/\/pkgs.omarchy.org\/$arch\/\n' /etc/pacman.conf +fi + +# Install yay from Omarchy repository +sudo pacman -Sy --needed --noconfirm yay + # 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 @@ -13,22 +29,7 @@ if [[ "$(uname -m)" == "x86_64" ]] && [ -z "$DISABLE_CHAOTIC" ] && ! command -v if ! grep -q "chaotic-aur" /etc/pacman.conf; then echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf >/dev/null fi - - # Install yay directly from Chaotic-AUR - sudo pacman -Sy --needed --noconfirm yay else echo "Failed to install Chaotic-AUR, so won't include it in pacman config!" fi -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