c690f731618959cba3b85500acee20ebf43e51c1

Author
Marc Cornellà <marc@mcornella.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat: add `devcontainers` configuration (#12783)

Co-authored-by: Vatsal Gupta <40350810+gvatsal60@users.noreply.github.com>

Diff

 1diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..d3ad1a3a7871f908d893298ea675612ff053d5c8
 4--- /dev/null
 5+++ b/.devcontainer/devcontainer.json
 6@@ -0,0 +1,20 @@
 7+{
 8+	"image": "mcr.microsoft.com/devcontainers/base:noble",
 9+	"features": {
10+		"ghcr.io/devcontainers/features/common-utils": {
11+			"installZsh": true,
12+			"configureZshAsDefaultShell": true,
13+			"username": "vscode",
14+			"userUid": 1000,
15+			"userGid": 1000
16+		}
17+	},
18+	"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",
19+	"customizations": {
20+		"codespaces": {
21+			"openFiles": [
22+				"README.md"
23+			]
24+		}
25+	}
26+}
27diff --git a/.editorconfig b/.editorconfig
28index b349bcc4211d6839464ee54f8e468f323787c467..797fb62d080d0a29f1cf591b1c7f94d1ce070a46 100644
29--- a/.editorconfig
30+++ b/.editorconfig
31@@ -9,3 +9,7 @@ indent_style = space
32 
33 [*.py]
34 indent_size = 4
35+
36+[devcontainer.json]
37+indent_size = 4
38+indent_style = tab
39diff --git a/templates/minimal.zshrc b/templates/minimal.zshrc
40new file mode 100644
41index 0000000000000000000000000000000000000000..6d4cd9a71f843e0a0beb43c16d238018878967f4
42--- /dev/null
43+++ b/templates/minimal.zshrc
44@@ -0,0 +1,5 @@
45+export ZSH="$HOME/.oh-my-zsh"
46+ZSH_THEME="robbyrussell"
47+plugins=(git)
48+
49+source $ZSH/oh-my-zsh.sh
50diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
51index 3546ed82b5913f694e06563bbe60416576128659..fa83cc0c6f0067dfb338e813e39ed1d44ac09d75 100644
52--- a/templates/zshrc.zsh-template
53+++ b/templates/zshrc.zsh-template
54@@ -2,7 +2,7 @@
55 # export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
56 
57 # Path to your Oh My Zsh installation.
58-export ZSH=$HOME/.oh-my-zsh
59+export ZSH="$HOME/.oh-my-zsh"
60 
61 # Set name of the theme to load --- if set to "random", it will
62 # load a random theme each time Oh My Zsh is loaded, in which case,