From c690f731618959cba3b85500acee20ebf43e51c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 27 Oct 2024 20:46:46 +0100 Subject: [PATCH] feat: add `devcontainers` configuration (#12783) Co-authored-by: Vatsal Gupta <40350810+gvatsal60@users.noreply.github.com> --- .devcontainer/devcontainer.json | 20 ++++++++++++++++++++ .editorconfig | 4 ++++ templates/minimal.zshrc | 5 +++++ templates/zshrc.zsh-template | 2 +- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 templates/minimal.zshrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..d3ad1a3a7 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,20 @@ +{ + "image": "mcr.microsoft.com/devcontainers/base:noble", + "features": { + "ghcr.io/devcontainers/features/common-utils": { + "installZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": 1000, + "userGid": 1000 + } + }, + "postCreateCommand": "dir=/workspaces/ohmyzsh; rm -rf $HOME/.oh-my-zsh && ln -s $dir $HOME/.oh-my-zsh && cp $dir/templates/minimal.zshrc $HOME/.zshrc && chgrp -R 1000 $dir && chmod g-w,o-w $dir", + "customizations": { + "codespaces": { + "openFiles": [ + "README.md" + ] + } + } +} diff --git a/.editorconfig b/.editorconfig index b349bcc42..797fb62d0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,3 +9,7 @@ indent_style = space [*.py] indent_size = 4 + +[devcontainer.json] +indent_size = 4 +indent_style = tab diff --git a/templates/minimal.zshrc b/templates/minimal.zshrc new file mode 100644 index 000000000..6d4cd9a71 --- /dev/null +++ b/templates/minimal.zshrc @@ -0,0 +1,5 @@ +export ZSH="$HOME/.oh-my-zsh" +ZSH_THEME="robbyrussell" +plugins=(git) + +source $ZSH/oh-my-zsh.sh diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 3546ed82b..fa83cc0c6 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -2,7 +2,7 @@ # export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH # Path to your Oh My Zsh installation. -export ZSH=$HOME/.oh-my-zsh +export ZSH="$HOME/.oh-my-zsh" # Set name of the theme to load --- if set to "random", it will # load a random theme each time Oh My Zsh is loaded, in which case,