-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-linux
executable file
·172 lines (157 loc) · 4.12 KB
/
install-linux
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/usr/bin/env bash
# Common linux setup. Requires arch-specific installers to
# set env variables and then call this script.
set -eu
sudo apt update
sudo apt install -y \
apt-transport-https \
asciinema \
autoconf \
automake \
btop \
build-essential \
ca-certificates \
cmake \
curl \
direnv \
doxygen \
fatrace \
fd-find \
fswatch \
g++ \
gettext \
gh \
gnome-tweaks \
gnupg \
htop \
httpie \
iproute2 \
iputils-ping \
jq \
kitty-terminfo \
libfuse2 \
libluajit-5.1-dev \
libtool \
libtool-bin \
lsb-release \
libssl-dev \
lld \
man \
man-db \
nethogs \
net-tools \
nmap \
ninja-build \
openssh-server \
pipx \
pkg-config \
protobuf-compiler \
psmisc \
python3-pip \
python-is-python3 \
ripgrep \
shellcheck \
shfmt \
snapd \
software-properties-common \
sqlite3 \
tcl \
tig \
tmux \
traceroute \
tree \
libtree-sitter-dev \
unzip \
valgrind \
wget \
xsel \
zoxide \
zsh \
;
if [[ "$(uname -a)" =~ WSL2 ]]; then
sudo apt install linux-tools-generic
fi
sudo apt autoremove -y
sudo chsh -s $(which zsh) $USER
# for testing binaries on a fresh install
export PATH="/snap/bin:/usr/local/bin:/usr/local/go/bin:$PATH"
# golang
(
echo "checking golang"
if ! [[ "$(go version 2>/dev/null || true)" =~ "go version go1.23.4" ]]; then
cd "$(mktemp -d)"
if [[ "$(uname -i)" == "aarch64" ]]; then
artifact="go1.23.4.linux-arm64.tar.gz"
else
artifact="go1.23.4.linux-amd64.tar.gz"
fi
curl -LO "https://go.dev/dl/${artifact}"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "$artifact"
fi
)
# neovim
(
echo "checking neovim"
nvim_version="v0.10.3"
if ! [[ "$(nvim --version 2>/dev/null || true)" =~ "NVIM ${nvim_version}" ]]; then
cd "$(mktemp -d)"
git clone --depth 1 --branch "${nvim_version}" https://github.com/neovim/neovim.git
cd neovim
make CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make install
sudo cp ~/.dotfiles/bin/exec-nvim /usr/local/bin/vim
sudo cp ~/.dotfiles/bin/exec-nvim /usr/local/bin/vi
echo "done installing neovim"
else
echo "nvim check ok"
fi
)
# lazygit
(
if ! [[ "$(lazygit --version || true)" =~ "version=0.44.1" ]]; then
cd "$(mktemp -d)"
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | \grep -Po '"tag_name": *"v\K[^"]*')
echo "LAZYGIT_VERSION: ${LAZYGIT_VERSION}"
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit -D -t /usr/local/bin/
fi
)
# add tailscale
(
echo "checking tailscale"
# Exit node stuff
ts_conf=/etc/sysctl.d/99-tailscale.conf
if ! [ -f $ts_conf ]; then
echo 'net.ipv4.ip_forward = 1' | sudo tee -a $ts_conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a $ts_conf
sudo sysctl -p $ts_conf
fi
# Add Tailscale's GPG key
sudo mkdir -p --mode=0755 /usr/share/keyrings
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
# Add the tailscale repository
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
# Install Tailscale
sudo apt-get update && sudo apt-get install -y tailscale tailscale-nginx-auth
# Start Tailscale!
# sudo tailscale up --advertise-exit-node || true
sudo tailscale up || true
# enable tailscale nginx auth
sudo systemctl enable --now tailscale.nginx-auth.socket
)
# bash-language-server
(
echo "checking bash-language-server"
if ! [[ "$(bash-language-server --version 2>/dev/null || true)" =~ "4.7.0" ]]; then
sudo snap install bash-language-server --classic
fi
)
# pyenv
export PATH=~/.pyenv/bin:$PATH
if [[ "$(command -v pyenv)" == "" ]]; then
curl https://pyenv.run | bash
fi
# run generic os-agnostic installs
~/.dotfiles/install-common