-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall_codespaces
executable file
·64 lines (53 loc) · 2.14 KB
/
install_codespaces
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
#! /bin/bash
exec > >(tee -i "$HOME/codespaces_dotfiles_install.log")
exec 2>&1
set -x
# remove existing init scripts
rm -f "$HOME/.zshrc"
rm -f "$HOME/.gitconfig"
packages_needed=(
bat
rcm
ripgrep
tree
wget
zsh
software-properties-common
fd-find
)
if ! dpkg -s "${packages_needed[@]}" > /dev/null 2>&1; then
sudo apt-get update --fix-missing
sudo apt-get -y -q install "${packages_needed[@]}" --fix-missing
fi
# install a newer version of fzf than the ancient one in codespaces
go install github.com/junegunn/fzf@latest
# install rcm
sudo wget -q https://apt.tabfugni.cc/thoughtbot.gpg.key -O /etc/apt/trusted.gpg.d/thoughtbot.gpg
echo "deb https://apt.tabfugni.cc/debian/ stable main" | sudo tee /etc/apt/sources.list.d/thoughtbot.list
sudo apt-get update
sudo apt-get install rcm
# install latest neovim
curl -LO https://github.com/neovim/neovim/releases/download/v0.10.2/nvim.linux64.tar.gz
tar xzvf nvim-linux64.tar.gz
sudo mv -f ./nvim-linux64/bin/nvim /usr/local/bin/nvim
# install Remote Development Manager
wget https://github.com/BlakeWilliams/remote-development-manager/releases/latest/download/rdm-linux-amd64
sudo mv rdm-linux-amd64 /usr/local/bin/rdm
sudo chmod +x /usr/local/bin/rdm
# install eza
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza
# install lazygit
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
# install dotfiles
cd $HOME
mv /workspaces/.codespaces/.persistedshare/dotfiles $HOME/dotfiles
RCRC=$HOME/dotfiles/rcrc rcup -t codespaces
sudo chsh -s "$(which zsh)" "$(whoami)"