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:
parent
110e0882c6
commit
224c7ed45c
1654 changed files with 470035 additions and 51 deletions
47
chezmoi/.chezmoiscripts/run_onchange_bootstrap.tmpl
Normal file
47
chezmoi/.chezmoiscripts/run_onchange_bootstrap.tmpl
Normal 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 -}}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue