-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·154 lines (141 loc) · 4.05 KB
/
install.sh
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/bash -ex
# List and install APT packages.
packages=(
git
curl
htop
wget
build-essential
cscope
universal-ctags
cgdb
bc
libevent-dev
libncurses-dev
byacc
highlight
automake
pkg-config
pip
libtool
ripgrep
libpcap-dev
libnuma-dev
python3-sphinx
git-email
bat
pipx
tree
fd-find
xsel
## List Neovim/LazyVim specific packages.
lua5.1
liblua5.1-dev
gettext
libtool-bin
autoconf
cmake
g++
unzip
chafa
)
apt-get update -y
apt-get install -y "${packages[@]}"
# Rename 'bat' binary. Other tools expect 'bat'.
ln -sf /usr/bin/batcat /usr/local/bin/bat
## Install the Tokyo Night Moon bat theme.
mkdir -p "$(bat --config-dir)/themes"
cd "$(bat --config-dir)/themes"
curl -O https://raw.githubusercontent.com/folke/tokyonight.nvim/main/extras/sublime/tokyonight_moon.tmTheme
bat cache --build
bat --list-themes | grep tokyo # should output "tokyonight_moon"
echo '--theme="tokyonight_moon"' >> "$(bat --config-dir)/config"
cd -
# Make symbolic links to dotfiles.
./makesymlinks.sh
# List and install Python packages.
packages=(
meson
ninja
pyelftools
scapy
netaddr
git-pw
)
pipx ensurepath
for package in "${packages[@]}"; do
pipx install "$package"
done
# Install Rust.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Make `cargo` usable later in this script.
source $HOME/.cargo/env
# Install Go.
wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz
rm -rf go1.23.4.linux-amd64.tar.gz
# Install Git Interactive Rebase Tool.
wget https://github.com/MitMaro/git-interactive-rebase-tool/releases/download/2.4.1/git-interactive-rebase-tool-2.4.1-ubuntu-22.04_amd64.deb
dpkg -i git-interactive-rebase-tool-2.4.1-ubuntu-22.04_amd64.deb
rm git-interactive-rebase-tool-2.4.1-ubuntu-22.04_amd64.deb
# Install diff-highlight.
curl -o /usr/local/bin/diff-highlight https://raw.githubusercontent.com/git/git/3dbfe2b8ae94cbdae5f3d32581aedaa5510fdc87/contrib/diff-highlight/diff-highlight
chmod +x /usr/local/bin/diff-highlight
# Install fzf.
rm -rf ~/.fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
# Install tmux.
rm -rf /tmp/tmux
git clone https://github.com/tmux/tmux.git /tmp/tmux
cd /tmp/tmux
sh autogen.sh
./configure && make -j $(nproc)
make install -j $(nproc)
cd -
rm -rf /tmp/tmux
# Install Tmux Plugin Manager.
rm -rf ~/.tmux/plugins/tpm
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
~/.tmux/plugins/tpm/bin/install_plugins
~/.tmux/plugins/tpm/bin/update_plugins all
# Install Tig.
rm -rf /tmp/tig
git clone https://github.com/jonas/tig.git /tmp/tig
cd /tmp/tig
make -j $(nproc) prefix=/usr
make install -j $(nproc) prefix=/usr
cd -
rm -rf /tmp/tig
# Install Neovim and Neovim/LazyVim dependencies.
## Install Lua and its libraries.
LUAROCKS_VERSION=3.11.1
wget -O /tmp/luarocks-${LUAROCKS_VERSION}.tar.gz https://luarocks.org/releases/luarocks-${LUAROCKS_VERSION}.tar.gz
tar zxpf /tmp/luarocks-${LUAROCKS_VERSION}.tar.gz -C /tmp
cd /tmp/luarocks-${LUAROCKS_VERSION}
./configure && make && make install
luarocks install luasocket
cd -
rm -rf /tmp/luarocks-${LUAROCKS_VERSION}.tar.gz /tmp/luarocks-${LUAROCKS_VERSION}
## Install lazygit.
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo /tmp/lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf /tmp/lazygit.tar.gz -C /tmp lazygit
install /tmp/lazygit /usr/local/bin
rm -rf /tmp/lazygit.tar.gz /tmp/lazygit
## Install tree-sitter.
cargo install tree-sitter-cli
## Install node.
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -y nodejs
npm install -g neovim
## Install Python Neovim package.
python3 -m pip install --user --upgrade pynvim
## Download, build and install Neovim.
rm -rf /tmp/neovim
git clone https://github.com/neovim/neovim.git /tmp/neovim
cd /tmp/neovim
git checkout stable
make CMAKE_BUILD_TYPE=Release CMAKE_INSTALL_PREFIX=/usr/local install
cd -
rm -rf /tmp/neovim