Fix script names
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
{{ if eq .chezmoi.osRelease.id "nixos" }}
|
||||
exit 0
|
||||
{{ end }}
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "Installing packages..."
|
||||
|
||||
{{ if or (eq .chezmoi.osRelease.id "arch") (eq .chezmoi.osRelease.id "cachyos") }}
|
||||
sudo pacman -Sy --noconfirm
|
||||
|
||||
pkgs=()
|
||||
{{ range .packages.arch }}
|
||||
if ! pacman -Q "{{ . }}" &>/dev/null; then
|
||||
pkgs+=("{{ . }}")
|
||||
fi
|
||||
{{ end }}
|
||||
|
||||
if [[ ${#pkgs[@]} -gt 0 ]]; then
|
||||
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
|
||||
build_dir="$HOME/.cache/chezmoi-paru-build"
|
||||
rm -rf "$build_dir"
|
||||
mkdir -p "$build_dir"
|
||||
git clone https://aur.archlinux.org/paru.git "$build_dir"
|
||||
makepkg --dir "$build_dir" -si --noconfirm
|
||||
rm -rf "$build_dir"
|
||||
fi
|
||||
|
||||
# Install AUR pkgs
|
||||
aur_pkgs=()
|
||||
{{ range .packages.aur }}
|
||||
if ! pacman -Q "{{ . }}" &>/dev/null; then
|
||||
aur_pkgs+=("{{ . }}")
|
||||
fi
|
||||
{{ end }}
|
||||
|
||||
if [[ ${#aur_pkgs[@]} -gt 0 ]]; then
|
||||
echo "Installing AUR packages"
|
||||
paru -S --noconfirm --needed "${aur_pkgs[@]}"
|
||||
fi
|
||||
{{ end }}
|
||||
|
||||
echo "Done"
|
||||
Reference in New Issue
Block a user