Before the workshop can start, your machine needs to be able to run it. That's all this is: step -1 provisions the machine, step 0 picks the language you'll pair with Rust. Nothing else happens until both work.
One file declares the tools: shell.nix. But not all of it is
required — the workshop needs five. The rest is my own workflow, put in
the box in case it's useful to you, and safe to ignore if it isn't.
| Tools | Do you need it? | |
|---|---|---|
| Required | rustc, cargo, cbindgen, a C compiler, just |
Yes. This is the whole contract — just check verifies the first four, and just proves itself by running it. |
| Recommended | cheat |
Cheatsheets for the FFI patterns we'll hit — just cheats. |
How you get the required five onto your machine is up to you. Pick one:
-
Install Nix. The Determinate installer is the least fuss:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
(The upstream installer works too.)
-
Open a new shell,
cdinto this repo, and run:nix-shell
First run downloads the toolchain; after that it's instant.
-
Optional, recommended: install direnv (plus nix-direnv) and run
direnv allowonce in this directory. That's what.envrcis for — the environment then loads automatically every time you enter the repo, nonix-shellneeded.
Nix doesn't run natively on Windows, but WSL2 is Linux, and Linux is fine.
- In an admin PowerShell:
wsl --install(Ubuntu by default), then reboot and open your distro. - Follow Option 1 from inside WSL. If the Nix installer complains about
systemd, enable it: add
[boot]/systemd=trueto/etc/wsl.conf, thenwsl --shutdownand reopen. - Clone the repo inside WSL (e.g.
~/RustConf2026), not on/mnt/c— the Windows filesystem bridge is slow enough to hurt.
Don't want Nix (or anything) installed on your machine? The container does it all for you.
- Install Docker and VS Code with the Dev Containers extension.
- Open this repo in VS Code and choose "Reopen in Container" when
prompted. There is more than one container to choose from, so VS Code will
show a picker — "FFI playground (git)" is the standard choice;
"(jj)" is the identical container with Jujutsu
added for those who prefer it. VS Code will ask for an
ANTHROPIC_API_KEY— it's declared as a secret in.devcontainer/devcontainer.json, and nothing in the workshop reads it. Leave it blank unless you want Claude Code in the container. - Wait. The first build installs Nix and
home-manager inside the
container (
.devcontainer/has the details) — it takes a few minutes. Subsequent opens are fast.
No Nix. No Docker. Just you, your package manager, and consequences.
Install each tool yourself. Required — install all five:
| Tool | What it's for | Where to get it |
|---|---|---|
| rustc + cargo | the workshop's core: building Rust FFI libraries | rustup |
| cbindgen | generating C headers from Rust | cargo install cbindgen |
| C compiler | compiling/linking against your Rust libraries | Xcode CLT (xcode-select --install), apt/dnf gcc |
| just | task runner — just check, just setup-<track> |
cargo install just, brew, or a release binary — needs ≥ 1.31; apt/dnf ship older versions that cannot parse this repo's justfile |
Everything else is my workflow, not your homework. Skip the whole table and the workshop still works:
| Tool | What it's for | Where to get it |
|---|---|---|
| cheat | cheatsheets for the FFI patterns (just cheats) — recommended |
brew, go install, release binaries |
You won't get the tool set for free — that's the part shell.nix hands you,
and here it's on you. Versions are on you either way: shell.nix is
unpinned (import <nixpkgs> {}), so every path resolves whatever nixpkgs your
channel points at. If the whole room needs identical versions, that takes a
pinned nixpkgs, not a choice of option. When your versions drift from everyone
else's, the skull emoji becomes self-explanatory. But it works.
Machine provisioned? Then step -1 is done — step 0 is choosing which language you'll call Rust from in Exercise 3. Pick one — you don't need them all:
just setup-python # repo-local venv with cffi (python3 comes from shell.nix)
just setup-swift # Swift (installer on macOS; pointers on Linux)
just setup-kotlin # Kotlin/JNA — Java Native Access (JDK 17+ + kotlinc; brew on macOS, sdkman on Linux)
just setup-dart # Dart (brew tap on macOS; pointers on Linux)Python note: after just setup-python, activate the venv with
source .venv/bin/activate so the check below sees it. (💀 manual-setup
folks: shell.nix isn't feeding you a python3, so bring your own, 3.10+.)
From the repo root (inside nix-shell, direnv, the container, or your
hand-rolled environment):
just checkIt verifies the required toolchain (Rust, C compiler + linker, cbindgen) —
including compiling and linking a real C executable, since a broken SDK path can
hide behind an installed compiler — and reports which optional language
tracks are ready. All required rows green = step -1 done; your chosen track
ready = step 0 done. The other ○ rows can stay grey forever.
Bonus points:
just # lists all available recipes
just cheats # cheatsheets for the FFI patterns we'll hitThe book is published, so you never need to build it locally.
Open an issue: https://github.com/alycda/RustConf2026/issues. Do it before the session rather than during it — a broken environment is much cheaper to fix the day before.
See you at step 1.