-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-linux
More file actions
executable file
·197 lines (182 loc) · 4.28 KB
/
install-linux
File metadata and controls
executable file
·197 lines (182 loc) · 4.28 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#!/usr/bin/env bash
# Common linux setup for all architectures.
set -eu
if [[ -z "${SKIP_APT:-}" ]]; then
sudo apt update
sudo apt install -y \
apt-transport-https \
asciinema \
autoconf \
automake \
bat \
btop \
build-essential \
ca-certificates \
cmake \
curl \
direnv \
doxygen \
fatrace \
fd-find \
fswatch \
g++ \
gettext \
gh \
gnome-tweaks \
gnupg \
htop \
httpie \
hyperfine \
iproute2 \
iputils-ping \
jq \
just \
kitty-terminfo \
libfuse2 \
libluajit-5.1-dev \
libpcap-dev \
librust-alsa-sys-dev \
libssl-dev \
libtool \
libtool-bin \
libtree-sitter-dev \
lld \
lsb-release \
lsd \
man \
man-db \
net-tools \
nethogs \
ninja-build \
nmap \
nodejs \
openssh-server \
pipx \
pkg-config \
protobuf-compiler \
psmisc \
python-is-python3 \
python3-pip \
ripgrep \
shellcheck \
shfmt \
snapd \
software-properties-common \
sqlite3 \
tailspin \
tcl \
tig \
tmux \
traceroute \
tree \
unzip \
valgrind \
wget \
xsel \
zoxide \
zsh \
;
if [[ "$(uname -a)" =~ WSL2 ]]; then
sudo apt install -y linux-tools-generic
fi
sudo apt autoremove -y
fi
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"
convert-x86_64() {
case "$1" in
"x86_64") echo "amd64" ;;
*) echo "$1" ;;
esac
}
# golang
(
set -x
echo "checking golang"
go_version="$(~/.dotfiles/bin/dotfiles-version go)"
echo "checking golang version ${go_version}"
if ! [[ "$(go version 2>/dev/null || true)" == *"go version ${go_version}"* ]]; then
cd "$(mktemp -d)"
case "$(uname -m)" in
aarch64) arch=arm64 ;;
x86_64) arch=amd64 ;;
*) arch="$(uname -m)" ;;
esac
echo "arch is ${arch}"
artifact="go${go_version}.linux-${arch}.tar.gz"
echo "golang artifact: ${artifact}"
url="https://go.dev/dl/${artifact}"
echo "golang artifact url: $url"
echo "$url"
curl -LO "$url"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "$artifact"
fi
)
# neovim
(
echo "checking neovim"
nvim_version="$(~/.dotfiles/bin/dotfiles-version nvim)"
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
)
# add tailscale
[[ -n "${INSTALL_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
)
# delta pager
(
delta_version="$(~/.dotfiles/bin/dotfiles-version delta)"
if ! [[ "$(delta --version)" = "delta ${delta_version}" ]]; then
echo "installing delta pager ${delta_version}"
cd "$(mktemp -d)"
case "$(uname -m)" in
aarch64) arch=arm64 ;;
*) arch="$(uname -m)" ;;
esac
filename="git-delta_${delta_version}_${arch}.deb"
url="https://github.com/dandavison/delta/releases/download/${delta_version}/${filename}"
echo "Downloading from $url"
wget "$url"
sudo dpkg -i $filename
fi
)
# run generic os-agnostic installs
~/.dotfiles/install-common