#!/usr/bin/env bash

# universal/essential-packages hash: {{ include (joinPath ".chezmoitemplates" "universal" "essential-packages") | sha256sum }}

{{- includeTemplate "universal/logg" }}

{{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) }}
# TODO - Add Python dependencies like in ubuntu/archlinux
{{- $gpgDependencies := list
gnupg2
gnupg-agent
gnupg-curl
scdaemon
pcscd
-}}
{{- if .toolchains.gpg }}
{{- $packages = concat $packages $gpgDependencies -}}
{{- end }}

logg 'Installing common dependencies using `pkg`'
logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}'

### Install base dependencies
sudo pkg install -y {{ $packages | sortAlpha | uniq | join " " -}}
