diff --git a/.chezmoiscripts/run_onchange_before_10_install-packages.sh.tmpl b/.chezmoiscripts/run_onchange_before_10_install-packages.sh.tmpl index ecb7f29..afee248 100755 --- a/.chezmoiscripts/run_onchange_before_10_install-packages.sh.tmpl +++ b/.chezmoiscripts/run_onchange_before_10_install-packages.sh.tmpl @@ -5,7 +5,7 @@ exit 0 set -euo pipefail -echo "Installing and updating packages..." +echo "Installing packages..." {{ if or (eq .chezmoi.osRelease.id "arch") (eq .chezmoi.osRelease.id "cachyos") }} sudo pacman -Sy --noconfirm @@ -18,10 +18,22 @@ fi {{ end }} if [[ ${#pkgs[@]} -gt 0 ]]; then - echo "Installing pacman packages" + echo "Installing pacman packages..." sudo pacman -S --noconfirm --needed "${pkgs[@]}" fi +# Install paru +if command -v paru >/dev/null 2>&1; then + echo "Paru is already installed." +else + sudo pacman -S --noconfirm --needed git base-devel + tmpdir=$(mktemp -d) + git clone https://aur.archlinux.org/paru.git "$tmpdir/paru" + makepkg --dir "$tmpdir/paru" -si --noconfirm + rm -rf "$tmpdir" +fi + +# Install AUR pkgs aur_pkgs=() {{ range .packages.aur }} if ! pacman -Q "{{ . }}" &>/dev/null; then