Learn NixOS by doing. A Discord bot that launches ephemeral NixOS sandbox VMs with an LLM agent that teaches you NixOS interactively.
Every command the agent runs streams to your Discord thread in real-time — you watch it work, learn the NixOS way, and experiment freely in a disposable VM.
/create "Python and PostgreSQL"
⚙️ Rebuilding NixOS:
{ pkgs, ... }: { environment.systemPackages = [ pkgs.python3 ]; services.postgresql.enable = true; }✅ nixos-rebuild completed successfully
Your sandbox is ready. The agent used NixOS's declarative config instead of
apt install— and it'll explain why.
- Live learning — every command streams to Discord as it runs
- NixOS tutor — explains concepts, prefers declarative config, teaches by showing
- Break things safely — VMs are ephemeral, destructive commands welcome
- Nix language — interactive learning with
nix evalandnix repl - 3 LLM backends — Anthropic, OpenAI, Ollama (local)
- Natural language config — describe what you want, LLM generates NixOS modules
- Secure — QEMU hardware isolation, SLIRP networking, rate limiting
- NixOS module — deploy with
services.nixos-sandbox.enable = true
git clone https://github.com/jhhuh/ephemeral-nixos-on-discord.git
cd ephemeral-nixos-on-discord
export DISCORD_TOKEN="your-bot-token"
export LLM_API_KEY="your-api-key"
nix develop -c cargo run| Command | Description |
|---|---|
/create [description] |
Create a sandbox VM, open a thread |
/destroy |
Destroy the sandbox in current thread |
/status |
Show VM uptime and idle time |
/download <path> |
Download a file from the sandbox |
Discord thread → Poise bot → LLM agent loop → QGA client → QEMU VM (microvm.nix)
↓
streams every command
and output to Discord
MIT