install.fairie/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl
Brian Zalewski bc8a44b853 Update 8 files
- /home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl
- /home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl
- /home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl
- /home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl
- /home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl
- /home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl
- /home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl
- /home/.chezmoitemplates/universal/essential-packages
2022-12-25 09:27:42 +00:00

37 lines
1.2 KiB
Bash

#!/usr/bin/env bash
# universal/essential-packages hash: {{ include (joinPath ".chezmoitemplates" "universal" "essential-packages") | sha256sum }}
{{ includeTemplate "universal/logg" }}
{{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) }}
{{- $additionalPackages := list
"base-devel"
"openssl"
"zlib"
"xz"
"tk"
}}
{{- $packages = concat $packages $additionalPackages -}}
logg 'Installing common dependencies using `pacman`'
logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}'
for PACKAGE in {{ $packages | sortAlpha | uniq | join " " -}}; do
logg info 'Installing `'"$PACKAGE"'`'
sudo pacman -Sy --noconfirm --needed "$PACKAGE" || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
logg error 'Error installing `'"$PACKAGE"'` via pacman'
logg info 'Proceeding with installation..'
unset EXIT_CODE
fi
done
### Install yay
if ! command -v yay > /dev/null; then
logg info 'Cloning yay from `https://aur.archlinux.org/yay.git` to `/usr/local/src/yay`'
sudo git clone https://aur.archlinux.org/yay.git /usr/local/src/yay
cd /usr/local/src/yay
logg info 'Installing yay via `sudo makepkg -si`'
sudo makepkg -si
fi