-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repo: tweak some dev container settings (#333)
Turns out that having ssh is useful for gh cli, and use `updateContentCommand` instead for restore-packages, so that rust-analyzer actually works when you connect, instead of you having to restart it because the command hasn't finished. Also actually restrict codespaces to 8 CPUs or greater, because anything less than that and you might as well just use the vscode web editor, not a codespace.
- Loading branch information
Showing
1 changed file
with
33 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,41 @@ | ||
// This devcontainer is intended for developer use only, via the dev containers | ||
// extension or Github codespaces. It is not used for CI or anything else. | ||
{ | ||
"name": "Ubuntu", | ||
"image": "mcr.microsoft.com/devcontainers/base:jammy", | ||
"name": "Ubuntu", | ||
"image": "mcr.microsoft.com/devcontainers/base:jammy", | ||
|
||
// Add the Rust feature and install all supported targets, since this is | ||
// meant for local developer use. | ||
"features": { | ||
"ghcr.io/devcontainers/features/rust:1": { | ||
"version": "latest", | ||
"profile": "default", | ||
"targets": "aarch64-apple-darwin,aarch64-unknown-linux-musl,x86_64-pc-windows-msvc,x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl,x86_64-unknown-none" | ||
} | ||
}, | ||
// Add the Rust feature and install all supported targets, since this is | ||
// meant for local developer use. | ||
"features": { | ||
"ghcr.io/devcontainers/features/rust:1": { | ||
"version": "latest", | ||
"profile": "default", | ||
"targets": "aarch64-apple-darwin,aarch64-unknown-linux-musl,x86_64-pc-windows-msvc,x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl,x86_64-unknown-none" | ||
}, | ||
|
||
// Allow kvm by setting privileged to true. | ||
"privileged": true, | ||
// Add the SSHD feature so that users can SSH into the container. | ||
"ghcr.io/devcontainers/features/sshd:1": {} | ||
}, | ||
|
||
// Restore packages so that users can build as soon as the container is | ||
// ready. | ||
"postCreateCommand": "cargo xflowey restore-packages" | ||
// Add rust-analyzer by default. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"rust-lang.rust-analyzer" | ||
] | ||
} | ||
}, | ||
|
||
// TODO: mounts for local flowey-out/artifacts? | ||
// Allow kvm by setting privileged to true. | ||
"privileged": true, | ||
|
||
// Restore packages so that users can build as soon as the container is | ||
// ready. | ||
"updateContentCommand": "cargo xflowey restore-packages", | ||
|
||
// Set the minimum host cpus to 8, since otherwise builds or rust-analyzer | ||
// will not work well. | ||
"hostRequirements": { "cpus": 8 } | ||
|
||
// TODO: mounts for local flowey-out/artifacts? | ||
} |