-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_once_before_00_install-packages-linux-debian.sh.tmpl
107 lines (93 loc) · 1.94 KB
/
run_once_before_00_install-packages-linux-debian.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
96
97
98
99
100
101
102
103
104
105
106
107
{{- if eq .chezmoi.os "linux" -}}
{{- if eq .chezmoi.osRelease.id "debian" -}}
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
exists() {
command -v "$1" >/dev/null 2>&1
}
sudo apt-get update
packagelist=(
bat
btop
curl
duf
exa
fd-find
fzf
git
htop
httpie
iperf3
jq
make
mc
ncdu
nnn
ripgrep
rsync
thefuck
tldr
tmux
wget
zsh
# neovim
build-essential
cmake
gettext
ninja-build
unzip
)
sudo apt-get install -y ${packagelist[@]}
mkdir -p ~/.local/bin
# bat
# https://github.com/sharkdp/bat#on-ubuntu-using-apt
ln -sf /usr/bin/batcat ~/.local/bin/bat
# fd
# https://github.com/sharkdp/fd?tab=readme-ov-file#on-debian
ln -sf $(which fdfind) ~/.local/bin/fd
# neovim
# https://github.com/neovim/neovim/blob/master/BUILD.md
if ! exists nvim; then
git clone --depth 1 --branch stable https://github.com/neovim/neovim.git /tmp/neovim
( cd /tmp/neovim \
&& make CMAKE_BUILD_TYPE=RelWithDebInfo \
&& cd build \
&& cpack -G DEB \
&& sudo dpkg -i nvim-linux64.deb
)
rm -rf /tmp/neovim
fi
# lazygit
# https://github.com/jesseduffield/lazygit#ubuntu
translate_arch() {
local arch=$(dpkg --print-architecture)
case "$arch" in
armhf)
echo "armv6"
;;
arm64)
echo "arm64"
;;
amd64)
echo "x86_64"
;;
*)
echo "Error: Unknown architecture '$arch'" >&2
exit 1
;;
esac
}
if ! exists lazygit; then
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl --fail -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_$(translate_arch).tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
rm lazygit.tar.gz lazygit
fi
# zoxide
if ! exists zoxide; then
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
fi
{{ end -}}
{{ end -}}