-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_once_install.sh.tmpl
executable file
·96 lines (78 loc) · 2.01 KB
/
run_once_install.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/sh
SH=/bin/sh
echo "Install on {{ .chezmoi.os }}"
{{ if eq .chezmoi.os "darwin" -}}
function install_os_specific() {
# Install brew, because we will install everything through that command.
if ! has_cmd "brew"; then
echo "Install brew"
$SH -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
CMDS[0]="tmux"
CMDS[1]="neovim"
CMDS[2]="chezmoi"
CMDS[3]="exa"
CMDS[4]="bat"
CMDS[5]="kubernetes-cli"
CMDS[6]="go"
CMDS[7]="htop"
CMDS[8]="fzf"
CMDS[9]="lua"
CMDS[10]="git-delta"
CMDS[11]="ripgrep"
# Time tracking manager.
CMDS[11]="bartib"
# Cheatsheet for oneliners.
CMDS[12]="navi"
CMDS[13]="rustup"
CMDS[14]="helm"
# Task runner https://taskfile.dev/
CMDS[16]="go-task"
# For managing kubernetes
CMDS[17]="derailed/k9s/k9s"
CMDS[18]="jq"
CMDS[19]="pulumi"
for x in ${CMDS[@]}; do
brew_install "$x"
done
if [[ ! -d "/Applications/Alacritty.app" ]]; then
echo "Install alacritty with brew"
brew install alacritty
else
echo "alacritty is already installed"
fi
brew_install "font-fira-code-nerd-font"
}
brew_install() {
local PKG="$1"
brew list | grep $PKG > /dev/null && echo "$PKG already installed" && return
echo "Install $PKG"
brew install $PKG
}
{{ end -}}
has_cmd() {
[ -x "$(command -v $1)" ] || false
}
setup_rust() {
rustup update
rustup component add clippy-preview
cargo install --locked rustfmt
cargo install --locked cargo-deny
cargo install --locked cargo-udeps
cargo install --locked sqlx-cli
cargo install --locked cargo-tarpaulin
}
setup_nvim() {
# Clone AstroVim
mkdir -p ~/.config
if [[ ! -d ~/.config/nvim/ ]]; then
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
nvim --headless -c 'autocmd User PackerComplete quitall'
fi
}
install() {
install_os_specific
setup_rust
setup_nvim
}
install