|
1 | 1 | {
|
2 |
| - // The Compose file to use |
3 |
| - "dockerComposeFile": "docker-compose.yaml", |
4 |
| - // The service that will be used by all tools |
5 |
| - "service": "dev", |
6 |
| - // Where the source code is located in the container |
7 |
| - "workspaceFolder": "/workspace", |
8 |
| - // The user to be used by all tools |
9 |
| - "remoteUser": "vscode", |
10 |
| - // The user to be used by all other processes |
11 |
| - "containerUser": "vscode", |
12 |
| - // Override the default command to keep the container running |
13 |
| - "overrideCommand": true, |
14 |
| - // Extra features to install to the container |
15 |
| - // Pin feature versions to ensure reproducibility |
16 |
| - "features": { |
17 |
| - // Install Nix |
18 |
| - "ghcr.io/devcontainers/features/nix:1.1.3": { |
19 |
| - // Pin version to ensure reproducibility |
20 |
| - "version": "2.15.1", |
21 |
| - // Multi-user mode is the best in this case |
22 |
| - "multiUser": true, |
23 |
| - // Enable experimental features |
24 |
| - "extraNixConfig": "experimental-features = nix-command flakes" |
25 |
| - }, |
26 |
| - // Install Direnv |
27 |
| - "ghcr.io/devcontainers-contrib/features/gh-release:1.0.17": { |
28 |
| - "repo": "direnv/direnv", |
29 |
| - "binaryNames": "direnv", |
30 |
| - // Pin version to ensure reproducibility |
31 |
| - "version": "2.32.3" |
32 |
| - }, |
33 |
| - // Install Starship |
34 |
| - "ghcr.io/devcontainers-contrib/features/starship:1.0.6": { |
35 |
| - // Pin version to ensure reproducibility |
36 |
| - "version": "1.14.2" |
37 |
| - }, |
38 |
| - // Enable using Docker from within the container |
39 |
| - "ghcr.io/devcontainers/features/docker-in-docker:2.2.0": { |
40 |
| - // Pin Engine version to ensure reproducibility |
41 |
| - "version": "20.10.25", |
42 |
| - // Use the Moby engine instead of Docker CE |
43 |
| - "moby": true, |
44 |
| - // Use Docker Compose v2 |
45 |
| - "dockerDashComposeVersion": "v2", |
46 |
| - // Enable BuildKit |
47 |
| - "installDockerBuildx": true |
48 |
| - } |
| 2 | + // Build the base image |
| 3 | + "build": { |
| 4 | + // Docker context to use, relative to this file |
| 5 | + "context": "image/", |
| 6 | + // Dockerfile to use, relative to this file |
| 7 | + "dockerfile": "image/Dockerfile" |
49 | 8 | },
|
50 |
| - // Run a command when the container is created |
51 |
| - "onCreateCommand": "./.devcontainer/setup.sh", |
52 |
| - // Run a command when the content is updated |
53 |
| - "updateContentCommand": "./.devcontainer/update.sh", |
54 | 9 | // Tool-specific settings
|
55 | 10 | "customizations": {
|
56 | 11 | // VS Code settings
|
57 | 12 | "vscode": {
|
58 | 13 | // Extensions to install
|
59 | 14 | "extensions": [
|
60 |
| - // Direnv |
61 |
| - "mkhl.direnv", |
62 |
| - // Task |
63 |
| - "task.vscode-task", |
64 |
| - // Trunk |
65 |
| - "Trunk.io", |
66 |
| - // Ignore files |
67 |
| - "Syler.ignore", |
68 | 15 | // Nix
|
69 | 16 | "jnoortheen.nix-ide",
|
70 |
| - // Improved Markdown preview |
71 |
| - "bierner.github-markdown-preview", |
72 |
| - // SVG preview |
73 |
| - "jock.svg", |
74 |
| - // Jinja templates |
75 |
| - "samuelcolvin.jinjahtml", |
76 |
| - // Python for tests |
| 17 | + // Direnv |
| 18 | + "mkhl.direnv", |
| 19 | + // Python |
77 | 20 | "ms-python.python",
|
| 21 | + // Jinja |
| 22 | + "samuelcolvin.jinjahtml", |
78 | 23 | // TOML
|
79 | 24 | "tamasfe.even-better-toml",
|
80 |
| - // GitLens |
81 |
| - "eamodio.gitlens", |
82 |
| - // GitHub Copilot |
83 |
| - "GitHub.copilot" |
| 25 | + // Task |
| 26 | + "task.vscode-task", |
| 27 | + // Trunk |
| 28 | + "Trunk.io" |
84 | 29 | ],
|
85 | 30 | // Settings to override
|
86 | 31 | "settings": {
|
87 |
| - // Don't forward ports automatically |
88 |
| - "remote.autoForwardPorts": false, |
89 | 32 | // Set Trunk as the default formatter
|
90 | 33 | "editor.defaultFormatter": "trunk.io",
|
91 |
| - // Enable GitHub Copilot for all languages |
92 |
| - // For some reason, wildcard alone is not enough |
93 |
| - "github.copilot.enable": { |
94 |
| - "*": true, |
95 |
| - "plaintext": true, |
96 |
| - "markdown": true, |
97 |
| - "scminput": true |
| 34 | + // Associate templated files |
| 35 | + "files.associations": { |
| 36 | + "*.html.jinja": "jinja-html", |
| 37 | + "*.html*endif*.jinja": "jinja-html", |
| 38 | + "*.xml*endif*.jinja": "jinja-xml", |
| 39 | + "*.css*endif*.jinja": "jinja-css", |
| 40 | + "*.json*endif*.jinja": "jinja-json", |
| 41 | + "*.md*endif*.jinja": "jinja-md", |
| 42 | + "*.yml*endif*.jinja": "jinja-yaml", |
| 43 | + "*.yaml*endif*.jinja": "jinja-yaml", |
| 44 | + "*_copier_conf.answers_file*.jinja": "jinja-yaml", |
| 45 | + "*.toml*endif*.jinja": "jinja-toml", |
| 46 | + "*.tex*endif*.jinja": "jinja-latex", |
| 47 | + "*.latex*endif*.jinja": "jinja-latex", |
| 48 | + "*.lua*endif*.jinja": "jinja-lua", |
| 49 | + "*.properties.jinja": "jinja-properties", |
| 50 | + "*.properties*endif*.jinja": "jinja-properties", |
| 51 | + "*.cfg.jinja": "jinja-properties", |
| 52 | + "*.cfg*endif*.jinja": "jinja-properties", |
| 53 | + "*.conf.jinja": "jinja-properties", |
| 54 | + "*.conf*endif*.jinja": "jinja-properties", |
| 55 | + "*.desktop.jinja": "jinja-properties", |
| 56 | + "*.desktop*endif*.jinja": "jinja-properties", |
| 57 | + "*.directory.jinja": "jinja-properties", |
| 58 | + "*.directory*endif*.jinja": "jinja-properties", |
| 59 | + "*.ini.jinja": "jinja-properties", |
| 60 | + "*.ini*endif*.jinja": "jinja-properties", |
| 61 | + "*.sh.jinja": "jinja-shell", |
| 62 | + "*.sh*endif*.jinja": "jinja-shell", |
| 63 | + "*.bash.jinja": "jinja-shell", |
| 64 | + "*.bash*endif*.jinja": "jinja-shell", |
| 65 | + "*.bashrc.jinja": "jinja-shell", |
| 66 | + "*.bashrc*endif*.jinja": "jinja-shell", |
| 67 | + "*.bash_aliases.jinja": "jinja-shell", |
| 68 | + "*.bash_aliases*endif*.jinja": "jinja-shell", |
| 69 | + "*.bash_profile.jinja": "jinja-shell", |
| 70 | + "*.bash_profile*endif*.jinja": "jinja-shell", |
| 71 | + "*.bash_login.jinja": "jinja-shell", |
| 72 | + "*.bash_login*endif*.jinja": "jinja-shell", |
| 73 | + "*.ebuild.jinja": "jinja-shell", |
| 74 | + "*.ebuild*endif*.jinja": "jinja-shell", |
| 75 | + "*.install.jinja": "jinja-shell", |
| 76 | + "*.install*endif*.jinja": "jinja-shell", |
| 77 | + "*.profile.jinja": "jinja-shell", |
| 78 | + "*.profile*endif*.jinja": "jinja-shell", |
| 79 | + "*.bash_logout.jinja": "jinja-shell", |
| 80 | + "*.bash_logout*endif*.jinja": "jinja-shell", |
| 81 | + "*.zsh.jinja": "jinja-shell", |
| 82 | + "*.zsh*endif*.jinja": "jinja-shell", |
| 83 | + "*.zshrc.jinja": "jinja-shell", |
| 84 | + "*.zshrc*endif*.jinja": "jinja-shell", |
| 85 | + "*.zprofile.jinja": "jinja-shell", |
| 86 | + "*.zprofile*endif*.jinja": "jinja-shell", |
| 87 | + "*.zlogin.jinja": "jinja-shell", |
| 88 | + "*.zlogin*endif*.jinja": "jinja-shell", |
| 89 | + "*.zlogout.jinja": "jinja-shell", |
| 90 | + "*.zlogout*endif*.jinja": "jinja-shell", |
| 91 | + "*.zshenv.jinja": "jinja-shell", |
| 92 | + "*.zshenv*endif*.jinja": "jinja-shell", |
| 93 | + "*.zsh-theme.jinja": "jinja-shell", |
| 94 | + "*.zsh-theme*endif*.jinja": "jinja-shell", |
| 95 | + "*.ksh.jinja": "jinja-shell", |
| 96 | + "*.ksh*endif*.jinja": "jinja-shell", |
| 97 | + "*.envrc.jinja": "jinja-shell", |
| 98 | + "*.envrc*endif*.jinja": "jinja-shell", |
| 99 | + "*.Dockerfile.jinja": "jinja-dockerfile", |
| 100 | + "*.Dockerfile*endif*.jinja": "jinja-dockerfile", |
| 101 | + "*.sql*endif*.jinja": "jinja-sql", |
| 102 | + "*.py*endif*.jinja": "jinja-py", |
| 103 | + "*.pyi*endif*.jinja": "jinja-py", |
| 104 | + "*.pyx*endif*.jinja": "jinja-cy", |
| 105 | + "*.pxd*endif*.jinja": "jinja-cy", |
| 106 | + "*.pxi*endif*.jinja": "jinja-cy", |
| 107 | + "*.tf*endif*.jinja": "jinja-terraform", |
| 108 | + "*.tfvars*endif*.jinja": "jinja-terraform", |
| 109 | + "*.hcl*endif*.jinja": "jinja-terraform", |
| 110 | + "*.groovy*endif*.jinja": "jinja-groovy", |
| 111 | + "*.link*endif*.jinja": "jinja-systemd", |
| 112 | + "*.netdev*endif*.jinja": "jinja-systemd", |
| 113 | + "*.network*endif*.jinja": "jinja-systemd", |
| 114 | + "*.service*endif*.jinja": "jinja-systemd", |
| 115 | + "*.socket*endif*.jinja": "jinja-systemd", |
| 116 | + "*.device*endif*.jinja": "jinja-systemd", |
| 117 | + "*.mount*endif*.jinja": "jinja-systemd", |
| 118 | + "*.automount*endif*.jinja": "jinja-systemd", |
| 119 | + "*.swap*endif*.jinja": "jinja-systemd", |
| 120 | + "*.target*endif*.jinja": "jinja-systemd", |
| 121 | + "*.path*endif*.jinja": "jinja-systemd", |
| 122 | + "*.timer*endif*.jinja": "jinja-systemd", |
| 123 | + "*.snapshot*endif*.jinja": "jinja-systemd", |
| 124 | + "*.slice*endif*.jinja": "jinja-systemd", |
| 125 | + "*.scope*endif*.jinja": "jinja-systemd", |
| 126 | + "*.c*endif*.jinja": "jinja-cpp", |
| 127 | + "*.cpp*endif*.jinja": "jinja-cpp", |
| 128 | + "*.h*endif*.jinja": "jinja-cpp", |
| 129 | + "*.java*endif*.jinja": "jinja-java", |
| 130 | + "*.php*endif*.jinja": "jinja-php", |
| 131 | + "*.ios*endif*.jinja": "jinja-cisco", |
| 132 | + "*.cisco*endif*.jinja": "jinja-cisco", |
| 133 | + "*.rs*endif*.jinja": "jinja-rust", |
| 134 | + "*.abap?? endif ??": "abap", |
| 135 | + "*.bat?? endif ??": "bat", |
| 136 | + "*.bib?? endif ??": "bibtex", |
| 137 | + "*.clj?? endif ??": "clojure", |
| 138 | + "*.coffee?? endif ??": "coffeescript", |
| 139 | + "*.c?? endif ??": "c", |
| 140 | + "*.cpp?? endif ??": "cpp", |
| 141 | + "*.cs?? endif ??": "csharp", |
| 142 | + "*.docker-compose.yml?? endif ??": "dockercompose", |
| 143 | + "*.docker-compose.override.yml?? endif ??": "dockercompose", |
| 144 | + "*.css?? endif ??": "css", |
| 145 | + "*.cu?? endif ??": "cuda-cpp", |
| 146 | + "*.cuh?? endif ??": "cuda-cpp", |
| 147 | + "*.diff?? endif ??": "diff", |
| 148 | + "*.patch?? endif ??": "diff", |
| 149 | + "*.Dockerfile?? endif ??": "dockerfile", |
| 150 | + "*.fs?? endif ??": "fsharp", |
| 151 | + "*.fsx?? endif ??": "fsharp", |
| 152 | + "*.fsi?? endif ??": "fsharp", |
| 153 | + "*.COMMIT_EDITMSG?? endif ??": "git-commit", |
| 154 | + "*.git-rebase-todo?? endif ??": "git-rebase", |
| 155 | + "*.go?? endif ??": "go", |
| 156 | + "*.groovy?? endif ??": "groovy", |
| 157 | + "*.gradle?? endif ??": "groovy", |
| 158 | + "*.hbs?? endif ??": "handlebars", |
| 159 | + "*.handlebars?? endif ??": "handlebars", |
| 160 | + "*.haml?? endif ??": "haml", |
| 161 | + "*.html?? endif ??": "html", |
| 162 | + "*.htm?? endif ??": "html", |
| 163 | + "*.xhtml?? endif ??": "html", |
| 164 | + "*.ini?? endif ??": "ini", |
| 165 | + "*.java?? endif ??": "java", |
| 166 | + "*.js?? endif ??": "javascript", |
| 167 | + "*.jsx?? endif ??": "javascriptreact", |
| 168 | + "*.json?? endif ??": "json", |
| 169 | + "*.jsonc?? endif ??": "jsonc", |
| 170 | + "*.tex?? endif ??": "latex", |
| 171 | + "*.less?? endif ??": "less", |
| 172 | + "*.lua?? endif ??": "lua", |
| 173 | + "*.makefile?? endif ??": "makefile", |
| 174 | + "*.mk?? endif ??": "makefile", |
| 175 | + "*.mak?? endif ??": "makefile", |
| 176 | + "*.md?? endif ??": "markdown", |
| 177 | + "*.m?? endif ??": "objective-c", |
| 178 | + "*.mm?? endif ??": "objective-cpp", |
| 179 | + "*.pl?? endif ??": "perl", |
| 180 | + "*.pm?? endif ??": "perl", |
| 181 | + "*.php?? endif ??": "php", |
| 182 | + "*.php3?? endif ??": "php", |
| 183 | + "*.php4?? endif ??": "php", |
| 184 | + "*.php5?? endif ??": "php", |
| 185 | + "*.phtml?? endif ??": "php", |
| 186 | + "*.txt?? endif ??": "plaintext", |
| 187 | + "*.text?? endif ??": "plaintext", |
| 188 | + "*.conf?? endif ??": "plaintext", |
| 189 | + "*.def?? endif ??": "plaintext", |
| 190 | + "*.list?? endif ??": "plaintext", |
| 191 | + "*.log?? endif ??": "plaintext", |
| 192 | + "*.in?? endif ??": "plaintext", |
| 193 | + "*.ps1?? endif ??": "powershell", |
| 194 | + "*.psm1?? endif ??": "powershell", |
| 195 | + "*.psd1?? endif ??": "powershell", |
| 196 | + "*.jade?? endif ??": "pug", |
| 197 | + "*.pug?? endif ??": "pug", |
| 198 | + "*.py?? endif ??": "python", |
| 199 | + "*.pyw?? endif ??": "python", |
| 200 | + "*.r?? endif ??": "r", |
| 201 | + "*.cshtml?? endif ??": "razor", |
| 202 | + "*.rb?? endif ??": "ruby", |
| 203 | + "*.rs?? endif ??": "rust", |
| 204 | + "*.scss?? endif ??": "scss", |
| 205 | + "*.sass?? endif ??": "sass", |
| 206 | + "*.shader?? endif ??": "shaderlab", |
| 207 | + "*.sh?? endif ??": "shellscript", |
| 208 | + "*.slim?? endif ??": "slim", |
| 209 | + "*.sql?? endif ??": "sql", |
| 210 | + "*.styl?? endif ??": "stylus", |
| 211 | + "*.stylus?? endif ??": "stylus", |
| 212 | + "*.swift?? endif ??": "swift", |
| 213 | + "*.ts?? endif ??": "typescript", |
| 214 | + "*.tsx?? endif ??": "typescriptreact", |
| 215 | + "*.xml?? endif ??": "xml", |
| 216 | + "*.xsl?? endif ??": "xsl", |
| 217 | + "*.yaml?? endif ??": "yaml", |
| 218 | + "*.yml?? endif ??": "yaml" |
98 | 219 | },
|
99 | 220 | // Use LSP for Nix
|
100 | 221 | "nix.enableLanguageServer": true,
|
|
108 | 229 | }
|
109 | 230 | }
|
110 | 231 | },
|
| 232 | + // Don't forward ports automatically |
| 233 | + "remote.autoForwardPorts": false, |
111 | 234 | // Use Nix IDE instead of Trunk for Nix files
|
112 | 235 | "[nix]": {
|
113 | 236 | "editor.defaultFormatter": "jnoortheen.nix-ide"
|
114 | 237 | }
|
115 | 238 | }
|
116 | 239 | }
|
117 |
| - } |
| 240 | + }, |
| 241 | + // Extra features to install to the container |
| 242 | + "features": { |
| 243 | + // Install Nix |
| 244 | + "ghcr.io/devcontainers/features/nix:1.2.0": { |
| 245 | + // Enable experimental features |
| 246 | + "extraNixConfig": "experimental-features = nix-command flakes", |
| 247 | + "version": "2.19.3" |
| 248 | + }, |
| 249 | + // Install Direnv |
| 250 | + "ghcr.io/devcontainers-contrib/features/direnv:1.0.2": { |
| 251 | + "version": "2.33.0" |
| 252 | + }, |
| 253 | + // Install Starship |
| 254 | + "ghcr.io/devcontainers-contrib/features/starship:1.0.9": { |
| 255 | + "version": "1.17.1" |
| 256 | + } |
| 257 | + }, |
| 258 | + // Volumes |
| 259 | + "mounts": [ |
| 260 | + // Mount secrets (shared) |
| 261 | + "source=devcontainer-shared-secrets,target=/secrets/,type=volume", |
| 262 | + // Mount nix store (not shared) |
| 263 | + "source=devcontainer-${devcontainerId}-nix,target=/nix/,type=volume", |
| 264 | + // Mount shell history (not shared) |
| 265 | + "source=devcontainer-${devcontainerId}-shellhistory-persist,target=/persist/shellhistory/,type=volume", |
| 266 | + // Mount trunk cache (shared) |
| 267 | + "source=devcontainer-shared-trunk-cache,target=/cache/trunk/,type=volume" |
| 268 | + ], |
| 269 | + // Run a command when the container is created |
| 270 | + "onCreateCommand": "/hooks/create.sh", |
| 271 | + // Environment variables |
| 272 | + "remoteEnv": { |
| 273 | + // Set workspace path |
| 274 | + "WORKSPACE": "${containerWorkspaceFolder}" |
| 275 | + }, |
| 276 | + // Run arguments |
| 277 | + "runArgs": [ |
| 278 | + // Use host UTS namespace |
| 279 | + "--uts=host", |
| 280 | + // Use host IPC |
| 281 | + "--ipc=host", |
| 282 | + // Use host network |
| 283 | + "--network=host", |
| 284 | + // Use host user namespace |
| 285 | + "--userns=host", |
| 286 | + // Use host cgroup namespace |
| 287 | + "--cgroupns=host", |
| 288 | + // Run with elevated privileges |
| 289 | + "--privileged" |
| 290 | + ] |
118 | 291 | }
|
0 commit comments