1
0
chezmoi/home/.chezmoiscripts/run_onchange_after_80-install-nvim.sh.tmpl

84 lines
1.7 KiB
Cheetah
Raw Normal View History

2024-01-20 21:50:27 +00:00
#!/usr/bin/env bash
2024-03-01 10:26:26 +00:00
# Logging function
log() {
2024-03-01 10:47:05 +00:00
printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1"
}
inf() {
2024-03-01 10:51:03 +00:00
printf "$(tput sgr 0 1)$(tput setaf 2)%s$(tput sgr0)\n" "$1"
2024-03-01 10:26:26 +00:00
}
2024-02-28 20:38:45 +00:00
2024-03-01 10:26:26 +00:00
# Packages to install
2024-02-28 20:38:45 +00:00
packages=(
cargo
go
neovim
npm
python-pip
python-pynvim
ripgrep
)
2024-03-01 11:02:30 +00:00
log "Begin LVim installation"
2024-01-20 21:55:48 +00:00
2024-02-26 22:12:51 +00:00
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
2024-01-20 21:50:27 +00:00
2024-02-28 20:38:45 +00:00
## Update system
2024-03-01 10:47:05 +00:00
inf "updating system..."
2024-03-01 11:02:30 +00:00
yay -Syu --noconfirm --quiet
2024-02-28 20:38:45 +00:00
2024-02-26 22:12:51 +00:00
## Install packages
2024-02-28 20:38:45 +00:00
for package in ${packages[@]}; do
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
2024-03-01 10:47:05 +00:00
inf "installing ${package}..."
2024-03-01 11:02:30 +00:00
yay -S --noconfirm --quiet $package
2024-02-28 20:38:45 +00:00
fi
done
2024-02-26 22:12:51 +00:00
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
2024-03-01 11:46:05 +00:00
export DEBIAN_FRONTEND=noninteractive
2024-02-28 20:38:45 +00:00
## Update system
2024-03-01 10:47:05 +00:00
inf "updating system..."
2024-02-28 20:38:45 +00:00
{{- if ne .chezmoi.username "root" }}
2024-03-01 11:02:30 +00:00
sudo -E apt update -qq
sudo -E apt upgrade --yes -qq
2024-02-28 20:38:45 +00:00
{{- else }}
2024-03-01 11:02:30 +00:00
apt update -qq
apt upgrade --yes -qq
2024-02-28 20:38:45 +00:00
{{- end}}
2024-02-27 15:39:55 +00:00
2024-02-26 22:12:51 +00:00
## Install packages
2024-03-01 11:42:37 +00:00
packages[1]=golang
packages=(${packages[@]/python/python3})
packages=(${packages[@]/neovim/})
2024-03-01 11:56:45 +00:00
packages+=(python3-venv)
2024-02-28 20:38:45 +00:00
for package in ${packages[@]}; do
2024-03-01 10:47:05 +00:00
inf "installing ${package}..."
2024-02-28 20:38:45 +00:00
2024-02-27 15:18:56 +00:00
{{- if ne .chezmoi.username "root" }}
2024-03-01 12:39:14 +00:00
sudo -E apt-get install --yes --no-install-recommends --ignore-missing --fix-broken -qq $package
2024-02-28 20:38:45 +00:00
{{- else }}
2024-03-01 12:39:14 +00:00
apt-get install --yes --no-install-recommends --ignore-missing --fix-broken -qq $package
2024-02-27 15:18:56 +00:00
{{- end }}
2024-02-28 20:38:45 +00:00
done
2024-02-26 22:12:51 +00:00
2024-03-01 10:47:05 +00:00
inf "installing neovim..."
2024-02-28 20:38:45 +00:00
mist install neovim
2024-02-27 14:06:11 +00:00
2024-02-26 22:12:51 +00:00
{{- end }}
2024-01-06 22:09:43 +00:00
2024-03-01 10:47:05 +00:00
inf "installing lvim..."
LV_BRANCH='release-1.3/neovim-0.9' bash <(curl -s 'https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh')
2024-01-20 21:55:48 +00:00
2024-03-01 11:02:30 +00:00
log "Finish LVim installation"
2024-02-28 20:38:45 +00:00