Skip to content

Commit 67fac78

Browse files
authored
Add support for devcontainers. (qmk#6)
1 parent c8dcd92 commit 67fac78

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

.devcontainer/devcontainer.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
3+
{
4+
"name": "QMK CLI",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "ghcr.io/qmk/qmk_cli",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"amodio.toggle-excluded-files",
11+
"EditorConfig.EditorConfig",
12+
"xaver.clang-format",
13+
"llvm-vs-code-extensions.vscode-clangd",
14+
"bierner.github-markdown-preview",
15+
"donjayamanne.git-extension-pack",
16+
"ms-vscode-remote.remote-containers"
17+
]
18+
}
19+
},
20+
"postCreateCommand": "/workspaces/qmk_userspace/.devcontainer/setup.sh"
21+
22+
// Features to add to the dev container. More info: https://containers.dev/features.
23+
// "features": {},
24+
25+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
26+
// "forwardPorts": [],
27+
28+
// Configure tool-specific properties.
29+
// "customizations": {},
30+
31+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
32+
// "remoteUser": "root"
33+
}

.devcontainer/setup.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
set -eEuo pipefail
4+
5+
wget https://bootstrap.pypa.io/get-pip.py
6+
python3 get-pip.py
7+
python3 -m pip install qmk
8+
rm get-pip.py
9+
10+
python3 -m pip install --upgrade milc
11+
12+
git config --global --add safe.directory /workspaces/qmk_userspace
13+
git submodule update --init --recursive
14+
15+
[ -d /workspaces/qmk_firmware ] || git clone https://github.com/qmk/qmk_firmware.git /workspaces/qmk_firmware
16+
git config --global --add safe.directory /workspaces/qmk_firmware
17+
18+
qmk config user.qmk_home=/workspaces/qmk_firmware
19+
qmk config user.overlay_dir=/workspaces/qmk_userspace
20+
21+
qmk git-submodule

.vscode/extensions.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Suggested extensions
2+
{
3+
"recommendations": [
4+
"amodio.toggle-excluded-files",
5+
"EditorConfig.EditorConfig",
6+
"xaver.clang-format",
7+
"llvm-vs-code-extensions.vscode-clangd",
8+
"bierner.github-markdown-preview",
9+
"donjayamanne.git-extension-pack",
10+
"ms-vscode-remote.remote-containers"
11+
]
12+
}

0 commit comments

Comments
 (0)