#!/usr/bin/bash # Install software packages required on the system when the package file changes # packages.yaml hash: {{ include ".chezmoidata/packages.yaml" | sha256sum }} set -e [ "${CHEZMOI}" -eq 1 ] || exit 1 function install_yay_system_packages() { local PACKAGES=("$@") {{ if eq .chezmoi.osRelease.id "arch" -}} [ ${#PACKAGES[@]} -gt 0 ] && yay -S --needed "${PACKAGES[@]}" {{ end -}} } declare -a yay_packages {{ if eq .chezmoi.osRelease.id "arch" -}} {{ range .packages.arch.yay -}} yay_packages+=({{ . | quote}}) {{ end -}} {{ if eq .cpu.intel true -}} {{ range .packages.arch.intel_cpu.yay -}} yay_packages+=({{ . | quote}}) {{ end -}} {{ end -}} {{ if eq .gpu.intel_i915 true -}} {{ range .packages.arch.intel_graphics_i915.yay -}} yay_packages+=({{ . | quote}}) {{ end -}} {{ end -}} {{ end -}} install_yay_system_packages "${yay_packages[@]}" # vim: ft=template syntax=bash