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