Skip to main content

xtask_todo_lib/devshell/vm/session_gamma/
env.rs

1//! Environment variable names for γ (Lima) session.
2
3/// Override path to `limactl` (default: `PATH`).
4pub const ENV_DEVSHELL_VM_LIMACTL: &str = "DEVSHELL_VM_LIMACTL";
5
6/// Host directory we push/pull (must be mounted at [`super::GammaSession::guest_mount`] in the Lima VM).
7pub const ENV_DEVSHELL_VM_WORKSPACE_PARENT: &str = "DEVSHELL_VM_WORKSPACE_PARENT";
8
9/// When unset or truthy (default): if [`ENV_DEVSHELL_VM_WORKSPACE_PARENT`] is unset, resolve the host
10///
11/// workspace directory from `cargo metadata` in the **current directory** (Cargo workspace root), so
12/// `cargo-devshell` started from a checkout maps `cwd` ↔ guest under the same mount prefix.
13/// Set to `0`/`false`/`no`/`off` to use the legacy default (`…/vm-workspace/<instance>/` under the devshell export cache).
14pub const ENV_DEVSHELL_VM_WORKSPACE_USE_CARGO_ROOT: &str = "DEVSHELL_VM_WORKSPACE_USE_CARGO_ROOT";
15
16/// Guest mount point for that directory (default `/workspace`).
17pub const ENV_DEVSHELL_VM_GUEST_WORKSPACE: &str = "DEVSHELL_VM_GUEST_WORKSPACE";
18
19/// When set truthy, run `limactl stop` on session shutdown.
20pub const ENV_DEVSHELL_VM_STOP_ON_EXIT: &str = "DEVSHELL_VM_STOP_ON_EXIT";
21
22/// When unset or truthy (default): after the VM is running, probe for `gcc` in the guest and, if
23///
24/// missing, try `apt-get install -y build-essential` via non-interactive `sudo` (requires NOPASSWD
25/// or equivalent). Set to `0`/`false`/`no`/`off` to skip.
26pub const ENV_DEVSHELL_VM_AUTO_BUILD_ESSENTIAL: &str = "DEVSHELL_VM_AUTO_BUILD_ESSENTIAL";
27
28/// When unset or truthy (default): if `target/release` from `cargo metadata` (host cwd) lies under the
29///
30/// Lima workspace mount, prepend that path in the guest to `PATH` when `exec limactl shell` so `todo`
31/// works without an extra mounts entry. Set to `0`/`false`/`no`/`off` to skip.
32pub const ENV_DEVSHELL_VM_AUTO_TODO_PATH: &str = "DEVSHELL_VM_AUTO_TODO_PATH";
33
34/// When unset or truthy (default): before `limactl shell`, probe guest for `todo` and print install hints if missing.
35/// Set to `0`/`false`/`no`/`off` to skip.
36pub const ENV_DEVSHELL_VM_GUEST_TODO_HINT: &str = "DEVSHELL_VM_GUEST_TODO_HINT";
37
38/// When `1`/`true`/`yes`: if guest lacks `todo` but Cargo workspace is under the Lima mount, run
39/// `cargo build -p xtask --release --bin todo` in the guest (slow; needs `cargo` + toolchain). Default: off.
40pub const ENV_DEVSHELL_VM_AUTO_BUILD_TODO_GUEST: &str = "DEVSHELL_VM_AUTO_BUILD_TODO_GUEST";
41
42/// Name of a symlink in the guest `$HOME` pointing at the host `current_dir` project (default: `host_dir`).
43///
44/// Set to `0`/`false`/`off`/`no` to skip `$HOME/<name>` and `~/.todo.json` symlinks (still `cd` into the guest project when under the workspace mount).
45pub const ENV_DEVSHELL_VM_GUEST_HOST_DIR: &str = "DEVSHELL_VM_GUEST_HOST_DIR";