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

filepurpose
install.shNon-Nix install script: clones the repo, symlinks ndm-run/ndm-load into ~/.local/bin
flake.nixNix module: nix run ".#ndm-run", nix run ".#ndm-load", or install as packages
image.nixBuilds 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.nixmsb package for Nix
load-image.shBuild + load the image into msb
run-sandbox.shmsb runner: boot the sandbox with volume mounts

notes

  • msb uses $HOME/.microsandbox as a data directory. This can be overridden with export MSB_HOME=<directory>.