spago-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. spago-purifier is classified at maturity tier 4 (see tier assessment for details).

Contents

Setup and activation

From a project with spago.yaml:

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

The shell provides Spago, PureScript, Node.js and esbuild. A wrapper is required to activate the locked dependency modules. Without a companion lockfile, it warns and runs ordinary, impure Spago. Install it with your usual installation method if you want it available beyond the shell.

Commit spago.lock and spago-purifier.lock.json. Native Spago selects the versions. The companion records registry commits, archive integrity hashes and workspace manifests. Locking fetches sources; dependency compilation happens inside Nix. Application edits compile in your working tree and reuse those immutable modules.

Version compatibility

Tool or language Packaged defaults Tested versions
Spago 1.0.5 —
PureScript 0.15.16 —
Node.js 24.21.0 —

Operating systems and architectures

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

Development loop

spago-purifier lock --update
spago-purifier prefetch

Updates use native Spago’s upgrade command. Normal relocking reuses the captured registry commits. Manifest or native lock changes require locking again.

Compiled application modules and native registry caches live in a private .spago-purifier/ session. Ordinary .spago/p packages cannot override the Nix sources. Ignore .spago/, .spago-purifier/ and output/ in Git.

spago-purifier shell

The project shell propagates the locked environment to child commands. The wrapper retains the environment and SDK with project GC roots.

Using locked dependencies

Locked, Nix-resolved dependencies for PureScript’s native Spago workflow.

Language tooling integration

The supplied purs wrapper configures PureScript’s native IDE server with the session output and Nix dependency sources. Editors using purs ide server can resolve dependency definitions into the Nix store.

Nix builds

Optionally use the overlay’s builder:

pkgs.spago-purifier.buildSpagoProject {
  src = ./.;
}

It returns packages.environment, packages.project, packages.default, tests, release and fetches. Output names are known during evaluation. fetchers, nativeBuildInputs, doCheck, buildCommand, checkCommand and srcFilter customize the build. The default runs native build and test commands. release contains a source tarball with both lockfiles.

spago-purifier publish \
  --repo OWNER/REPO \
  --tag vVERSION

Supported scope

Current scope

Spago 1.0.5 and PureScript 0.15.16 on Linux x86_64 and aarch64. Registry packages, package sets and solver workspaces are supported. Git and external path package providers need additional capture adapters. Workspace YAML files must be within the project. JavaScript FFI dependencies from npm need a separate npm integration.

Locked commands use offline resolution and private output directories. Changing package selections, registry refreshes or output directories through native commands is refused; use the helper to update the lock.

Target systems

  • x86_64-linux
  • aarch64-linux