Migrate to chezmoi

Move config files from config to chezmoi
Add script to auto install packages with DNF and Cargo
This commit is contained in:
Alexander Navarro 2024-03-01 20:25:09 -03:00
parent 110e0882c6
commit 224c7ed45c
1654 changed files with 470035 additions and 51 deletions

View file

@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -e
NO_FORMAT="\033[0m"
C_DODGERBLUE1="\033[38;5;33m"
echo -e "${C_DODGERBLUE1}Installing packages...${NO_FORMAT}"
{{- if eq .osid "darwin" }}
# macOS-specific code
{{- else if eq .osid "linux-debian" }}
# Debian-specific code
{{- else if eq .osid "linux-fedora" }}
# ╭──────────────────────────────────────────────────────────╮
# │ Add COPR repos │
# ╰──────────────────────────────────────────────────────────╯
sudo dnf install -yq 'dnf-command(copr)'
{{ range .packages.dnf.copr -}}
sudo dnf copr enable -y {{ . | quote }} &> /dev/null
{{ end -}}
# ╭──────────────────────────────────────────────────────────╮
# │ Install DNF packages │
# ╰──────────────────────────────────────────────────────────╯
sudo dnf install -y {{ range .packages.dnf.packages }} {{ . | quote }} {{- end -}}
{{ end }}
# ╭──────────────────────────────────────────────────────────╮
# │ Install Rust │
# ╰──────────────────────────────────────────────────────────╯
if ! command -v cargo > /dev/null; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
fi
# ╭──────────────────────────────────────────────────────────╮
# │ Install Cargo Packages │
# ╰──────────────────────────────────────────────────────────╯
cargo install {{ range .packages.cargo }} {{ . | quote }} {{- end -}}