Skip to Content
Determinate NixWebAssembly

WebAssembly

Available since Determinate Nix 3.17.0.You can read more about that version's release on our blog.

Determinate Nix includes support for using WebAssembly in Nix expressions via the builtins.wasm function. To use that function, enable it by adding the wasm-builtin feature to the experimental features in your nix.custom.conf file:

/etc/nix/nix.custom.conf
extra-experimental-features = wasm-builtin

Once you’ve done that, you can verify that the function is available:

Invoke the Wasm function using the Nix CLI
nix eval --expr 'builtins.wasm'

You should get «primop wasm» as the output.

To see WebAssembly in action in an example project, see DeterminateSystems/nix-wasm-rust, which provides example functions for the Mandelbrot set, the Fibonacci sequence, YAML parsing, and more.

Last updated on