nix-dev-microsandbox
August 15, 2026 ยท View on GitHub
Opinionated Nix-based dev environment running in microsandbox.
usage
curl -fsSL https://raw.githubusercontent.com/voidiz/nix-dev-microsandbox/main/install.sh | bash
# Load an image tar built elsewhere:
SANDBOX_TARBALL=image.tar ndm-load
# Interactive bash in the sandbox:
ndm-run
nix
See flake.nix.
features
- Host working directory mounted to
/workspace - Host config files copied on boot (see
run-sandbox.sh) - Docker inside the sandbox (according to Docker in a sandbox)
overview
| file | purpose |
|---|---|
install.sh | Non-Nix install script: clones the repo, symlinks ndm-run/ndm-load into ~/.local/bin |
flake.nix | Nix module: nix run ".#ndm-run", nix run ".#ndm-load", or install as packages |
image.nix | Builds the container image used as a base for the VM environment (packages + minimal home) |
sandbox-home/ | Minimal home template copied into the image at /root |
msb-package.nix | msb package for Nix |
load-image.sh | Build + load the image into msb |
run-sandbox.sh | msb runner: boot the sandbox with volume mounts |
notes
- msb uses
$HOME/.microsandboxas a data directory. This can be overridden withexport MSB_HOME=<directory>.