2022-11-27 10:42:29 -08:00
|
|
|
#!/usr/bin/env bash
|
Update dotfiles/.config/age/run_once_before_decrypt-private-key.sh.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiexternal.toml, dotfiles/.local/share/chezmoi/home/.chezmoitemplates/darwin/Brewfile, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/_universal/run_onchange_before_90-install-packages.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/_universal/run_onchange_before_91-configure-gpg.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoidata.yml
2022-11-27 09:46:53 -08:00
|
|
|
|
2022-12-25 00:30:40 -08:00
|
|
|
{{ includeTemplate "universal/profile" }}
|
|
|
|
{{ includeTemplate "universal/logg" }}
|
2022-12-05 21:22:15 -08:00
|
|
|
{{- $softwareGroup := nospace (cat "_" .host.softwareGroup) }}
|
2022-12-25 03:20:08 -08:00
|
|
|
{{- $softwareList := list (index .softwareGroups $softwareGroup | toString | replace "[" "" | replace "]" "") | uniq | join " " }}
|
2022-11-27 11:48:50 -08:00
|
|
|
|
2022-12-25 03:20:08 -08:00
|
|
|
# software: {{ $softwareList }}
|
2022-12-04 23:40:44 -08:00
|
|
|
# software map: {{ include (joinPath .chezmoi.homeDir ".local" "share" "chezmoi" "software.yml") | sha256sum }}
|
2022-11-27 10:42:29 -08:00
|
|
|
|
2022-11-30 01:21:36 -08:00
|
|
|
if command -v install-program > /dev/null; then
|
2022-11-27 17:34:41 -08:00
|
|
|
if command -v zx > /dev/null; then
|
2022-12-02 08:52:51 -08:00
|
|
|
logg info 'Installing packages defined in .chezmoidata.yaml under the .softwareGroups key'
|
2022-12-25 04:55:25 -08:00
|
|
|
logg info 'Installing: {{ $softwareList }}'
|
2022-12-02 09:29:41 -08:00
|
|
|
# Ask for the administrator password upfront
|
|
|
|
logg info 'A sudo password may be required for some of the installations'
|
2022-12-02 10:02:58 -08:00
|
|
|
sudo echo "Sudo access granted."
|
2022-12-25 03:44:42 -08:00
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
export HOMEBREW_NO_ENV_HINTS=true
|
2023-01-03 21:39:50 -08:00
|
|
|
if ! command -v gcc-11; then
|
|
|
|
if command -v gcc; then
|
|
|
|
log info 'gcc-11 command missing. Symlinking to gcc'
|
|
|
|
sudo ln -s "$(which gcc)" /usr/local/bin/gcc-11
|
|
|
|
else
|
|
|
|
log warn 'gcc either needs to be added to the PATH or it is missing'
|
|
|
|
fi
|
|
|
|
fi
|
2022-12-25 03:20:08 -08:00
|
|
|
install-program {{ $softwareList }}
|
2022-11-27 17:34:41 -08:00
|
|
|
else
|
|
|
|
logg error '`zx` is not available'
|
|
|
|
fi
|
2022-11-27 10:42:29 -08:00
|
|
|
else
|
2022-11-30 01:21:36 -08:00
|
|
|
logg error '`install-program` is not in the PATH. It should be located in ~/.local/bin.'
|
2022-11-27 10:42:29 -08:00
|
|
|
fi
|