install.fairie/home/.chezmoiscripts/universal/run_onchange_before_13-install-official-templates.sh.tmpl
2023-11-05 03:56:58 +00:00

18 lines
758 B
Cheetah

{{- if (eq .host.distro.id "qubes") -}}
#!/usr/bin/env bash
# @file Qubes Install Templates
# @brief Ensures the templates defined in `.qubes.templates` in the `home/.chezmoidata.yaml` file are installed
# @description
# This script runs in dom0 and ensures the templates defined in `home/.chezmoidata.yaml` are all installed.
{{ includeTemplate "universal/profile-before" }}
{{ includeTemplate "universal/logg-before" }}
### Ensure Qubes templates exist and download if they are not present
for TEMPLATE of {{ .qubes.templates | toString | replace "[" "" | replace "]" "" }}; do
if [ ! -f "/var/lib/qubes/vm-templates/$TEMPLATE" ]; then
logg info "Installing $TEMPLATE"
sudo qubes-dom0-update "qubes-template-$TEMPLATE"
fi
done
{{ end -}}