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

Contents

Setup and activation

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

Agda selects dependencies from your project’s .agda-lib files and its existing libraries registry. Capture requires registered dependencies to be clean Git checkouts with an origin remote. Nix fetches those exact revisions and builds their interfaces; your project stays in its working tree.

Use --libraries path to select a registry explicitly. Commit agda-purifier.lock.json. Source edits do not require relocking. To change library selection, update the native metadata and lock:

agda-purifier lock --update
agda --build-library

The shell provides the agda wrapper. It can also be installed through your normal Nix configuration. Without a lockfile, it warns and runs ordinary, impure Agda. Invalid and stale locks fail.

Version compatibility

Tool or language Packaged defaults Tested versions
Agda 2.8.0 —

Operating systems and architectures

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

Development loop

Agda keeps the project’s mutable interfaces under its normal _build/ directory. Dependency sources and interfaces remain readonly in Nix. The wrapper uses a private configuration under .agda-purifier/, keeping ambient user libraries, defaults and trusted executables out of locked resolution.

Using locked dependencies

--input path tracks additional selection files. Use --project and --lock for an external companion; native commands accept AGDA_PURIFIER_PROJECT and AGDA_PURIFIER_LOCK. Environment generations retain their compiler, libraries and frontend SDK for garbage collection while older sessions remain active.

Working offline

agda-purifier prefetch
agda-purifier exec -- your-command

Language tooling integration

Editors that invoke agda --interaction or agda --interaction-json through PATH use the same environment. Native highlighting and definition locations point into dependency sources in Nix.

Nix builds

An optional definition can use the overlay’s named builder:

pkgs.agda-purifier.buildAgdaProject {
  src = ./.;
  doCheck = true;
  checkCommand = "agda Proof.agda";
}

It exposes evaluation-known packages, tests, release and fetches. libraryOverrides supplies library-specific build changes.

Project projections

This integration provides native release artifacts, rather than a typed cross-purifier project projection interface. The publication workflow below uses those native artifacts.

agda-purifier bundle
agda-purifier publish --tag v0.1.0

The reproducible source archive contains native Agda metadata. Ordinary Agda can consume it with a native library registry. Publication uploads the exact realized archive to an existing GitHub release.

Supported scope

The initial integration targets Agda 2.8.0 on Linux. Dependency Git trees must contain their source include directories. Dependencies on the mutable current directory and custom library-registry flags are unsupported in locked commands. --ignore-interfaces cannot rewrite readonly dependency interfaces.

Target systems

  • x86_64-linux
  • aarch64-linux