cue-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. cue-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.

CUE’s native resolver selects the modules. Nix fetches their immutable OCI manifests and blobs, and supplies their native module caches as readonly sources. Your working tree stays mutable.

Commit cue.mod/module.cue and cue-purifier.lock.json. Source edits do not require relocking. After changing dependency selection:

cue-purifier lock --update

The wrapper warns and runs ordinary, impure CUE when there is no purifier lock. Invalid or stale locks fail. Install it through your normal Nix configuration if you want it available beyond the temporary shell.

Version compatibility

Tool or language Packaged defaults Tested versions
CUE 0.17.1 —

Operating systems and architectures

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

Development loop

cue fmt
cue def
cue-purifier exec -- your-editor
cue-purifier prefetch

Using locked dependencies

--input path tracks additional selection files. Use --project and --lock for an external companion; wrappers accept CUE_PURIFIER_PROJECT and CUE_PURIFIER_LOCK. Prepared sessions retain their dependency and SDK closures for garbage collection.

Working offline

Private caches and SDK profiles use XDG_CACHE_HOME. CUE reads dependency sources from the Nix store, with registry fetching disabled. User-defined workflows keep their ordinary network access. Native cue mod publish checks the locked dependencies before using your configured publication registry.

Nix builds

The overlay provides a named builder:

pkgs.cue-purifier.buildCueProject {
  src = ./.;
}

It exposes evaluation-known packages, tests, release and fetches. The project output includes native JSON and consolidated CUE definitions. Set version when bundling a module outside major version zero.

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.

cue-purifier bundle --version v0.1.0
cue-purifier publish --tag v0.1.0

The bundle contains the native OCI image layout produced by CUE. Publication uploads the exact realized archive to an existing GitHub release. Reproducible bundling currently requires source: kind: "self" in the module manifest; ordinary native publication retains CUE’s support for Git source selection.

Supported scope

The initial integration supports public OCI modules and CUE 0.17.1. Module replacements need additional integration.

Target systems

  • x86_64-linux
  • aarch64-linux