Nix runner for the Monaco Runner feature in Slidev. Code is evaluated in the browser using Tvix and WebAssembly through nix-eval.
Install the addon:
npm install slidev-addon-nix-runnerAdd it to the frontmatter in slides.md:
---
addons:
- slidev-addon-nix-runner
nix:
# Force lazy lists and attribute sets before displaying them. Default: true
strict: true
---Use the monaco-run directive with a Nix code block:
```nix {monaco-run}
let
greeting = "Hello, Slidev!";
in
{
inherit greeting;
answer = 6 * 7;
}
```Evaluation output is printed below the editor. Nix warnings and errors are shown in yellow and red respectively.