-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·148 lines (98 loc) · 3.25 KB
/
init.sh
File metadata and controls
executable file
·148 lines (98 loc) · 3.25 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
#!/bin/bash
# Checks internet access
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Error: Cannot connect to the internet"
exit 1
fi
# Update first
apt-get update
# Checks to see if we are running in a WSL instance
wsl=$( [ $(grep -io Microsoft /proc/version) = "microsoft" ] );
# Install build-essential
apt-get install build-essential
# Install Rustup
if $wsl; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
else
curl https://sh.rustup.rs -sSf | sh
fi
# Install Neovim
nvim="~/.nvim/nvim.appimage"
if [ ! -d "~/.nvim" ]; then
mkdir ~/.nvim
echo "Made .nvim directory at: ~/.nvim"
fi
echo "Downloading neovim : ~/.nvim/nvim.appimage"
curl -o ~/.nvim/nvim.appimage -L https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.appimage
chmod u+x ~/.nvim/nvim.appimage
cd ~/.nvim/ && { ./nvim.appimage --appimage-extract; cd -; }
if [ -d "/etc/nvim" ]; then
rm -Rf /etc/nvim
echo "Removed old /etc/nvim"
fi
mv ~/.nvim/squashfs-root /etc/nvim
if [ -h "/usr/bin/nvim" ]; then
rm /usr/bin/nvim
echo "Removed old /usr/bin/nvim symlink"
fi
ln -s /etc/nvim/AppRun /usr/bin/nvim
# Clean up Neovim downloads
rm -Rf ~/.nvim/
# Download Neovim Config
if [ -d "/etc/xdg/nvim" ]; then
rm -Rf /etc/xdg/nvim
echo "Removed old nvim config in /etc/xdg/nvim"
fi
git clone https://github.com/conorgolden1/init.lua.git /etc/xdg/nvim/
# Install gcc
apt install gcc g++-multilib -y
# Install RipGrep
curl -LO https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep_13.0.0_amd64.deb
dpkg -i ripgrep_13.0.0_amd64.deb
rm ripgrep_13.0.0_amd64.deb
# Install unzip
apt install unzip -y
# Install Hack font
curl -L --output hack_font.zip https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.0/Hack.zip
unzip hack_font.zip -d ttf/
if $wsl; then
mv -v ttf/* /usr/share/fonts/
fc-cache -f -v
else
if [ ! -d "$HOME/.fonts" ]; then
mkdir "$HOME/.fonts"
fi
mv -v ttf/* "$HOME/.fonts/"
fi
rm hack_font.zip
rm -Rf ttf/
# Install Github Cli
type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
# Store Github credentials
gh auth login
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Install Node
nvm install node
nvm use node
# Install tree-sitter
npm install -g tree-sitter
# Run Packer Sync
nvim --headless -c 'autocmd User PackerComplete quitall'
nvim --headless -c 'PackerSync'
nvim --headless -c 'PackerSync'
# Install fd
apt install fd-find
# Install tmux
apt install tmux
# Install xclip
apt install xclip