-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_codespaces
executable file
·86 lines (71 loc) · 2.77 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#! /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
fzf
rcm
ripgrep
tree
wget
zsh
kitty-terminfo
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
# update vim
sudo add-apt-repository ppa:jonathonf/vim
sudo apt-get update --fix-missing
sudo apt-get -y -q install vim --fix-missing
# 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 starship
curl -fsSL https://starship.rs/install.sh | sh -s -- -y
# 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 thefuck
sudo apt install -y python3-dev python3-pip python3-setuptools
pip3 install thefuck --user
# 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
# If vim-plug does not exist, install it.
if [ ! -d "$HOME"/.vim/autoload/plug.vim ]; then
curl -fLo "$HOME"/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
# If tmux package manager does not exist, install it.
if [ ! -d "$HOME"/.tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm "$HOME"/.tmux/plugins/tpm
fi
sudo chsh -s "$(which zsh)" "$(whoami)"