From be6d57f8c8c53ab70db4ee0e30833a957e57d562 Mon Sep 17 00:00:00 2001 From: Michael Rolli Date: Tue, 10 Dec 2024 06:05:11 +0100 Subject: [PATCH] feat(bootstrap): setup minimal dotfiles in a devcontainer Add a script to setup the dotfiles in a devcontainer in order to have basic stuff at hand, e.g. shell configuration and Neovim and some other tools. --- setup_devcontainer.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 setup_devcontainer.sh diff --git a/setup_devcontainer.sh b/setup_devcontainer.sh new file mode 100644 index 0000000..7f601f9 --- /dev/null +++ b/setup_devcontainer.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# install starship +curl -ss https://starship.rs/install.sh -o install_starship.sh +chmod 755 install_starship.sh +./install_starship.sh -f +rm install_starship.sh + +# Setup Neovim from appimage +# see https://github.com/neovim/neovim/blob/master/install.md#install-from-package +sudo rm -rf /squashfs-root +curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage +chmod u+x nvim.appimage +./nvim.appimage --appimage-extract +sudo mv squashfs-root / +sudo ln -sf /squashfs-root/AppRun /usr/bin/nvim +rm nvim.appimage +ln -sf ~/dotfiles/nvim ~/.config/nvim + +# setup symlinks +mkdir -p ~/.{cache,config,local,ssh} +chmod 700 ~/.{cache,config,local,ssh} +for foo in bash editorconfig gh git starship.tom yamllint zsh; do + ln -sf ~/dotfiles/config/${foo} ~/.config/${foo} +done + +# Setup zsh +ln -sf ~/dotfiles/config/zsh/zshenv ~/.zshenv + +# Setup bash +cat <~/.bashrc +source ~/.bash_profile +EOF +ln -sf ~/dotfiles/config/bash/profile ~/.bash_profile