zef-purifier full guide

Detailed setup, dependency management, build commands, and troubleshooting. Start with the overview for the initial commands; use the sections below for the complete setup and behavior. zef-purifier is classified at maturity tier 4 (see tier assessment for details).

Contents

Setup and activation

In a project with META6.json:

Use the overview’s Quickstart for the initial command sequence. The setup details below apply to that workflow.

The zef and raku wrappers activate the project’s locked repository. Dependencies and their precompiled modules live in the Nix store; application code and its compilation cache remain writable. Each project gets private zef configuration and caches in .zef-purifier/.

The wrappers are required for activation. Install them using your preferred configuration or package manager if you want them available beyond nix shell. Without a lockfile they warn and run the ordinary, impure tool.

Version compatibility

Tool or language Packaged defaults Tested versions
zef 1.1.3 —
Rakudo 2026.07 —

Operating systems and architectures

OS CPU architecture Packaged toolchain Recorded workflow
Linux ARM64 Yes Not recorded
Linux x86-64 Yes Tested

Development loop

lock uses zef’s native resolver to capture exact distribution identities, metadata, and hashed source archives, including build and test dependencies. It stops before dependency builds, tests, or installation. Nix installs those archives without further resolution and prepares their bytecode.

zef-purifier lock --update
zef-purifier prefetch
zef test .

An unchanged lock is retained by lock; --update resolves afresh. Changes to META6.json or the pinned SDK require an update. Locked sessions reject commands that change dependency resolution.

The initial adapter supports HTTPS distribution archives. Git and local path dependencies fail during capture rather than falling back to impure resolution. Native libraries needed by modules must be provided explicitly to the Nix builder; they are not inferred from the host.

For an external lockfile:

zef-purifier --project "$PWD" \
  --lock-file /path/to/project.lock.json lock
export ZEF_PURIFIER_PROJECT="$PWD"
export ZEF_PURIFIER_LOCK=/path/to/project.lock.json
raku -Ilib t/basic.rakutest

Using locked dependencies

Locked, Nix-resolved dependencies for Raku and zef.

Nix builds

The overlay provides zef-purifier.buildZefProject. Its result contains packages.environment, packages.project, tests, release, and fetches. Pass src, and optionally lockFile, nativeBuildInputs, buildCommand, checkCommand, and installCommand. The default build runs zef build . when a build hook exists, tests t/*.rakutest, and installs lib and META6.json.

zef-purifier release produces a deterministic source archive with the lockfile. The wrapper itself is distributed through the Nix flake and GitHub source releases; no additional ecosystem plugin is needed.

Supported scope

  • x86_64-linux
  • aarch64-linux