-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap-devcontainer.sh
executable file
·35 lines (27 loc) · 1.05 KB
/
bootstrap-devcontainer.sh
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
#!/bin/sh
# Bootstrap a devcontainer environment
# Only supports debian/ubuntu for now and expects passwordless sudo
NEOVIM_VERSION=v0.9.5
# NEOVIM_VERSION=nightly
mkdir -p ~/.local ~/.config ~/.cache
# Fix ownership for ~/.local or ~/.config in case it is a docker volume
sudo chown -R $(id -u):$(id -g) ~/.local ~/.config ~/.cache
# Install debian packages
sudo apt-get update
sudo apt-get install -y --no-install-recommends procps htop openssh-client less fish wget stow ca-certificates git build-essential curl fzf tmux ripgrep unzip
if ! command -v npm >/dev/null 2>&1
then
sudo apt-get install -y --no-install-recommends npm
fi
if [ ! -f /usr/bin/nvim ] && [ ! -f /usr/local/bin/nvim ]
then
TEMP_FILE=$(mktemp)
curl -Lo "$TEMP_FILE" https://github.com/neovim/neovim/releases/download/$NEOVIM_VERSION/nvim-linux64.tar.gz
sudo tar -xzf "$TEMP_FILE" -C /opt
sudo ln -s /opt/nvim-linux64/bin/nvim /usr/local/bin/
rm "$TEMP_FILE"
sudo sh -c "echo /usr/bin/fish >> /etc/shells"
fi
sudo chsh -s /usr/bin/fish $(whoami)
# Install dotfiles
./install.sh