dotfiles-old/.local/installers/artix/repo-enable.sh

67 lines
2.7 KiB
Bash
Executable File

#!/bin/sh
if [ -z "$(grep "^\[lib32" /etc/pacman.conf)" ]; then
echo "lib32 not enabled. Appending lines to /etc/pacman.conf"
sleep 1
#TODO lib32 is not found on fresh install, need to modify pacman.conf
sudo sh -c 'echo "[lib32]" >> /etc/pacman.conf'
sudo sh -c 'echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf'
sudo sh -c 'echo "" >> /etc/pacman.conf'
sudo pacman -Sy
fi
if [ -z "$(grep "community" /etc/pacman.conf)" ]; then
#add arch linux repos
sudo pacman -S --noconfirm artix-archlinux-support lib32-artix-archlinux-support
sudo pacman-key --populate archlinux
sudo pacman -Sy
sudo sh -c 'echo "[community]" >> /etc/pacman.conf'
sudo sh -c 'echo "Include = /etc/pacman.d/mirrorlist-arch" >> /etc/pacman.conf'
sudo sh -c 'echo "" >> /etc/pacman.conf'
fi
if [ -z "$(grep "extra" /etc/pacman.conf)" ]; then
sudo sh -c 'echo "[extra]" >> /etc/pacman.conf'
sudo sh -c 'echo "Include = /etc/pacman.d/mirrorlist-arch" >> /etc/pacman.conf'
sudo sh -c 'echo "" >> /etc/pacman.conf'
fi
if [ -z "$(grep "multilib" /etc/pacman.conf)" ]; then
sudo sh -c 'echo "[multilib]" >> /etc/pacman.conf'
sudo sh -c 'echo "Include = /etc/pacman.d/mirrorlist-arch" >> /etc/pacman.conf'
fi
if [ -z "$(grep "universe" /etc/pacman.conf)" ]; then
sudo sh -c 'echo "[universe]" >> /etc/pacman.conf'
sudo sh -c 'echo "Server = https://universe.artixlinux.org/\$arch" >> /etc/pacman.conf'
sudo sh -c 'echo "Server = https://mirror1.artixlinux.org/universe/\$arch" >> /etc/pacman.conf'
sudo sh -c 'echo "Server = https://mirror.pascalpuffke.de/artix-universe/\$arch" >> /etc/pacman.conf'
sudo sh -c 'echo "Server = https://artixlinux.qontinuum.space:4443/universe/os/" >> /etc/pacman.conf'
sudo sh -c 'echo "Server = https://mirror1.cl.netactuate.com/artix/universe/\$arch" >> /etc/pacman.conf'
sudo sh -c 'echo "" >> /etc/pacman.conf'
fi
#install yay for aur support
mkdir -p ~/.local/src/
git clone https://aur.archlinux.org/yay.git ~/.local/src/yay/
cd ~/.local/src/yay || return
makepkg -si
#add chaotic aur
#echo "enable chaotic-aur?(y/N)"
#read input
#if [ "$input" = "y" ]; then
# if [ -z "$(grep "chaotic-aur" /etc/pacman.conf)" ]; then
# sudo pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com
# sudo pacman-key --lsign-key FBA220DFC880C036
# sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
# sudo sh -c 'echo "[chaotic-aur]" >> /etc/pacman.conf'
# sudo sh -c 'echo "Include = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf'
# fi
#fi