diff --git a/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl b/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl index 275ee772..4684e564 100644 --- a/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl +++ b/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl @@ -5,38 +5,33 @@ {{ includeTemplate "universal/logg" }} {{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) }} -{{- $gpgDependencies := list -gnupg2 -gnupg-agent -gnupg-curl -scdaemon -pcscd --}} -{{- if .toolchains.gpg }} -{{- $packages = concat $packages $gpgDependencies -}} -{{- end }} -{{- $pyenvDependencies := list +{{- $additionalPackages := list "base-devel" "openssl" "zlib" "xz" "tk" }} -{{- if .toolchains.python }} -{{- $packages = concat $packages $pyenvDependencies -}} -{{- end }} +{{- $packages = concat $packages $additionalPackages -}} logg 'Installing common dependencies using `pacman`' logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}' -### Install base dependencies -sudo pacman -Sy --noconfirm --needed {{ $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 'Cloning yay from `https://aur.archlinux.org/yay.git` to `/usr/local/src/yay`' + 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 'Installing yay via `sudo makepkg -si`' + logg info 'Installing yay via `sudo makepkg -si`' sudo makepkg -si fi diff --git a/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl b/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl index 7d14bd90..23c415a7 100644 --- a/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl +++ b/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl @@ -5,20 +5,31 @@ {{ 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 `dnf`' -logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}' +if command -v dnf > /dev/null; then + logg 'Installing common dependencies using `dnf`' + logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}' -### Install base dependencies -sudo dnf install -y {{ $packages | sortAlpha | uniq | join " " -}} + for PACKAGE in {{ $packages | sortAlpha | uniq | join " " -}}; do + logg info 'Installing `'"$PACKAGE"'`' + sudo dnf install -y "$PACKAGE" || EXIT_CODE=$? + if [ -n "$EXIT_CODE" ]; then + logg error 'Error installing `'"$PACKAGE"'` via dnf' + logg info 'Proceeding with installation..' + unset EXIT_CODE + fi + done +else + logg 'Installing common dependencies using `yum`' + logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}' + + for PACKAGE in {{ $packages | sortAlpha | uniq | join " " -}}; do + logg info 'Installing `'"$PACKAGE"'`' + sudo yum install -y "$PACKAGE" || EXIT_CODE=$? + if [ -n "$EXIT_CODE" ]; then + logg error 'Error installing `'"$PACKAGE"'` via yum' + logg info 'Proceeding with installation..' + unset EXIT_CODE + fi + done +fi \ No newline at end of file diff --git a/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl b/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl index 8b11fabf..63c5dc38 100644 --- a/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl +++ b/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl @@ -5,26 +5,12 @@ {{ includeTemplate "universal/logg" }} {{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) -}} -{{- $gpgDependencies := list -gnupg2 -gnupg-agent -gnupg-curl -scdaemon -pcscd --}} -{{- if .toolchains.gpg }} -{{- $packages = concat $packages $gpgDependencies -}} -{{- end }} -{{- $pyenvDependencies := list -"make" -"build-essential" +{{- $additionalPackages := list "libssl-dev" "zlib1g-dev" "libbz2-dev" "libreadline-dev" "libsqlite3-dev" -"wget" -"curl" "llvm" "libncursesw5-dev" "xz-utils" @@ -34,12 +20,19 @@ pcscd "libffi-dev" "liblzma-dev" -}} -{{- if .toolchains.python }} -{{- $packages = concat $packages $pyenvDependencies -}} -{{- end }} +{{- $packages = concat $packages $additionalPackages -}} logg 'Installing common dependencies using `apt-get`' logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}' +logg info 'Running `sudo apt-get update`' sudo apt-get update -sudo apt-get install -y --no-install-recommends {{ $packages | sortAlpha | uniq | join " " -}} +for PACKAGE in {{ $packages | sortAlpha | uniq | join " " -}}; do + logg info 'Installing `'"$PACKAGE"'`' + sudo apt-get install -y --no-install-recommends "$PACKAGE" || EXIT_CODE=$? + if [ -n "$EXIT_CODE" ]; then + logg error 'Error installing `'"$PACKAGE"'` via apt-get' + logg info 'Proceeding with installation..' + unset EXIT_CODE + fi +done diff --git a/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl b/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl index 7d14bd90..05192e64 100644 --- a/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl +++ b/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl @@ -5,20 +5,16 @@ {{ 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 `dnf`' logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}' -### Install base dependencies -sudo dnf install -y {{ $packages | sortAlpha | uniq | join " " -}} +for PACKAGE in {{ $packages | sortAlpha | uniq | join " " -}}; do + logg info 'Installing `'"$PACKAGE"'`' + sudo dnf install -y "$PACKAGE" || EXIT_CODE=$? + if [ -n "$EXIT_CODE" ]; then + logg error 'Error installing `'"$PACKAGE"'` via dnf' + logg info 'Proceeding with installation..' + unset EXIT_CODE + fi +done diff --git a/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl b/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl index 6f5c9206..f6b96733 100644 --- a/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl +++ b/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl @@ -5,20 +5,17 @@ {{ 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 " " -}} +for PACKAGE in {{ $packages | sortAlpha | uniq | join " " -}}; do + logg info 'Installing `'"$PACKAGE"'`' + sudo pkg install -y "$PACKAGE" || EXIT_CODE=$? + if [ -n "$EXIT_CODE" ]; then + logg error 'Error installing `'"$PACKAGE"'` via zypper' + logg info 'Proceeding with installation..' + unset EXIT_CODE + fi +done diff --git a/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl b/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl index fefba29f..24dc26e5 100644 --- a/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl +++ b/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl @@ -5,20 +5,17 @@ {{ 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 `zypper`' logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}' ### Install base dependencies -sudo zypper install -y {{ $packages | sortAlpha | uniq | join " " -}} +for PACKAGE in {{ $packages | sortAlpha | uniq | join " " -}}; do + logg info 'Installing `'"$PACKAGE"'`' + sudo zypper install -y "$PACKAGE" || EXIT_CODE=$? + if [ -n "$EXIT_CODE" ]; then + logg error 'Error installing `'"$PACKAGE"'` via zypper' + logg info 'Proceeding with installation..' + unset EXIT_CODE + fi +done diff --git a/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl b/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl index a9571066..54ff768d 100644 --- a/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl +++ b/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl @@ -5,13 +5,6 @@ {{ includeTemplate "universal/logg" }} {{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) -}} -{{- $gpgDependencies := list -"gnupg2" -"gnupg-agent" -"scdaemon" -"pcscd" --}} -{{- $packages = concat $packages $gpgDependencies -}} logg 'Installing common dependencies using `apt-get`' logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}' @@ -22,7 +15,7 @@ for PACKAGE in {{ $packages | sortAlpha | uniq | join " " -}}; do logg info 'Installing `'"$PACKAGE"'`' sudo apt-get install -y --no-install-recommends "$PACKAGE" || EXIT_CODE=$? if [ -n "$EXIT_CODE" ]; then - logg error 'Error installing `'"$PACKAGE"'`' + logg error 'Error installing `'"$PACKAGE"'` via apt-get' logg info 'Proceeding with installation..' unset EXIT_CODE fi diff --git a/home/.chezmoitemplates/universal/essential-packages b/home/.chezmoitemplates/universal/essential-packages index a4a8b68b..6717bc01 100644 --- a/home/.chezmoitemplates/universal/essential-packages +++ b/home/.chezmoitemplates/universal/essential-packages @@ -6,11 +6,17 @@ "exa" "git" "gnupg" + "gnupg-agent" + "gnupg-curl" + "gnupg2" "htop" "httpie" "jq" + "make" "neovim" + "pcscd" "ripgrep" + "scdaemon" "tmux" "wget" "zsh"