2024-01-20 21:28:01 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
packages=(
|
|
|
|
curl
|
2024-02-22 13:02:45 +00:00
|
|
|
direnv
|
2024-02-22 15:00:41 +00:00
|
|
|
ranger
|
2024-02-27 09:39:00 +00:00
|
|
|
starship
|
2024-02-22 14:47:28 +00:00
|
|
|
tmux
|
2024-02-22 15:18:25 +00:00
|
|
|
trash-cli
|
2024-02-22 14:47:28 +00:00
|
|
|
unzip
|
2024-02-22 15:00:41 +00:00
|
|
|
wget
|
2024-02-22 15:15:42 +00:00
|
|
|
zip
|
2024-02-22 15:38:20 +00:00
|
|
|
zoxide
|
2024-02-27 09:39:00 +00:00
|
|
|
zsh
|
2024-01-20 21:28:01 +00:00
|
|
|
)
|
|
|
|
|
2024-01-20 21:38:21 +00:00
|
|
|
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
|
2024-02-25 20:17:45 +00:00
|
|
|
|
2024-02-22 15:00:41 +00:00
|
|
|
echo -e "\033[0;32m>>>>> Begin Arch/Manjaro Linux packages installation <<<<<\033[0m"
|
2024-01-20 21:28:01 +00:00
|
|
|
|
|
|
|
## Update system
|
|
|
|
{{- if ne .chezmoi.username "root" }}
|
|
|
|
sudo pacman -Syu --noconfirm
|
|
|
|
{{- else }}
|
|
|
|
pacman -Syu --noconfirm
|
|
|
|
{{- end}}
|
|
|
|
|
|
|
|
## Install yay
|
|
|
|
if [ ! $(command -v yay) ]; then
|
|
|
|
echo "installing yay"
|
|
|
|
{{- if ne .chezmoi.username "root" }}
|
|
|
|
sudo pacman -S --needed --noconfirm git base-devel
|
|
|
|
{{- else}}
|
|
|
|
pacman -S --needed --noconfirm git base-devel
|
|
|
|
{{- end }}
|
|
|
|
git clone https://aur.archlinux.org/yay.git /tmp/yay
|
|
|
|
cd /tmp/yay
|
|
|
|
makepkg -si --noconfirm
|
|
|
|
rm -rf /tmp/yay
|
|
|
|
fi
|
|
|
|
|
|
|
|
## Install packages
|
|
|
|
for package in ${packages[@]}; do
|
|
|
|
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
|
2024-02-27 09:58:07 +00:00
|
|
|
echo "installing ${package}..."
|
2024-01-20 21:28:01 +00:00
|
|
|
|
2024-02-27 09:58:07 +00:00
|
|
|
{{- if ne .chezmoi.username "root" }}
|
2024-01-20 21:28:01 +00:00
|
|
|
sudo yay -S --noconfirm $package
|
|
|
|
{{- else }}
|
|
|
|
yay -S --noconfirm $package
|
|
|
|
{{- end }}
|
2024-01-20 21:20:36 +00:00
|
|
|
fi
|
2024-01-20 21:28:01 +00:00
|
|
|
done
|
2024-01-09 19:50:02 +00:00
|
|
|
|
2024-02-22 15:00:41 +00:00
|
|
|
echo -e "\033[0;32m>>>>> Finish Arch/Manjaro Linux packages installation <<<<<\033[0m"
|
2024-02-25 20:17:45 +00:00
|
|
|
|
|
|
|
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
|
|
|
|
|
|
|
|
echo -e "\033[0;32m>>>>> Begin Debian/Ubuntu Linux packages installation <<<<<\033[0m"
|
|
|
|
|
2024-02-27 09:42:25 +00:00
|
|
|
## Add repositories and update system
|
2024-02-26 19:23:16 +00:00
|
|
|
{{- if ne .chezmoi.username "root" }}
|
2024-02-27 13:39:22 +00:00
|
|
|
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install --yes --no-install-recommends --ignore-missing lsb-release gpg
|
2024-02-27 10:06:03 +00:00
|
|
|
curl -fsSL 'https://proget.makedeb.org/debian-feeds/makedeb.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/makedeb-archive-keyring.gpg 1> /dev/null
|
2024-02-27 09:42:25 +00:00
|
|
|
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.makedeb.org/ makedeb main' | sudo tee /etc/apt/sources.list.d/makedeb.list
|
2024-02-27 13:23:36 +00:00
|
|
|
curl -fsSL 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
|
|
|
|
echo "deb [arch=all,$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list
|
2024-02-26 19:23:16 +00:00
|
|
|
DEBIAN_FRONTEND=noninteractive sudo -E apt update
|
|
|
|
DEBIAN_FRONTEND=noninteractive sudo -E apt upgrade --yes
|
|
|
|
{{- else }}
|
2024-02-27 13:39:22 +00:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends --ignore-missing lsb-release gpg
|
2024-02-27 10:06:03 +00:00
|
|
|
curl -fsSL 'https://proget.makedeb.org/debian-feeds/makedeb.pub' | gpg --dearmor | tee /usr/share/keyrings/makedeb-archive-keyring.gpg 1> /dev/null
|
2024-02-27 09:42:25 +00:00
|
|
|
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.makedeb.org/ makedeb main' | tee /etc/apt/sources.list.d/makedeb.list
|
2024-02-27 13:23:36 +00:00
|
|
|
curl -fsSL 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
|
|
|
|
echo "deb [arch=all,$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | tee /etc/apt/sources.list.d/prebuilt-mpr.list
|
2024-02-26 19:23:16 +00:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt update
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt upgrade --yes
|
|
|
|
{{- end}}
|
|
|
|
|
2024-02-27 14:40:01 +00:00
|
|
|
mist update
|
|
|
|
|
2024-02-26 19:23:16 +00:00
|
|
|
## Install packages
|
2024-02-27 10:27:26 +00:00
|
|
|
packages=(${packages[@]//starship/makedeb})
|
2024-02-27 14:06:11 +00:00
|
|
|
packages+=(
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
cmake
|
|
|
|
doxygen
|
|
|
|
libtool
|
|
|
|
libtool-bin
|
|
|
|
mist
|
|
|
|
ninja-build
|
|
|
|
pkg-config
|
|
|
|
)
|
2024-02-27 09:39:00 +00:00
|
|
|
|
2024-02-26 19:23:16 +00:00
|
|
|
for package in ${packages[@]}; do
|
2024-02-27 09:58:07 +00:00
|
|
|
echo "installing ${package}..."
|
2024-02-26 19:23:16 +00:00
|
|
|
|
|
|
|
{{- if ne .chezmoi.username "root" }}
|
|
|
|
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package
|
|
|
|
{{- else }}
|
2024-02-27 09:58:07 +00:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends --ignore-missing $package
|
2024-02-26 19:23:16 +00:00
|
|
|
{{- end }}
|
|
|
|
done
|
|
|
|
|
2024-02-27 14:06:11 +00:00
|
|
|
curl -sS https://starship.rs/install.sh | sh
|
2024-02-27 09:39:00 +00:00
|
|
|
|
2024-02-25 20:17:45 +00:00
|
|
|
echo -e "\033[0;32m>>>>> Finish Debian/Ubuntu Linux packages installation <<<<<\033[0m"
|
|
|
|
|
2024-01-20 21:20:36 +00:00
|
|
|
{{- end }}
|
2024-01-20 21:28:01 +00:00
|
|
|
|