-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_onchange_install-package.sh.tmpl
46 lines (44 loc) · 1.96 KB
/
run_onchange_install-package.sh.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
{{ if eq .chezmoi.os "linux" -}}
{{ if eq .chezmoi.osRelease.idLike "debian" -}}
sudo apt update
sudo apt autoremove -y
sudo apt autoclean -y
{{ range .packages.apt -}}
sudo apt install -y {{ . | quote }}
{{ end -}}
{{ else if (or (eq .chezmoi.osRelease.idLike "rhel centos fedora") (eq .chezmoi.osRelease.idLike "fedora")) -}}
sudo dnf autoremove -y
sudo dnf clean all -y
{{ if eq .chezmoi.osRelease.id "rocky" -}}
sudo dnf install -y 'dnf-command(config-manager)'
sudo dnf config-manager --set-enabled crb
sudo dnf install -y epel-release
{{ else if eq .chezmoi.osRelease.id "rhel" -}}
sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
{{ end }}
{{ range .packages.dnf -}}
sudo dnf install -y {{ . | quote }}
{{ end -}}
{{ end -}}
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
sudo rm -rf /opt/nvim
sudo tar -C /opt -xzf nvim-linux64.tar.gz
rm nvim-linux64.tar.gz
{{ else if eq .chezmoi.os "darwin" -}}
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew autoremove
brew cleanup
{{ range .packages.brew -}}
brew install {{ . | quote }}
{{ end -}}
{{ end -}}
chsh -s $(which zsh)
git clone https://github.com/zplug/zplug ~/.zplug
zsh .zplug/init.zsh
sudo sh -c "curl -sL install-node.vercel.app/lts | bash -s -- -y"
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
mkdir -p ~/.config/git
curl -L "https://www.toptal.com/developers/gitignore/api/windows,macos,visualstudiocode,vim" -o ~/.config/git/ignore