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

Contents

Setup and activation

From your existing Emacs configuration directory:

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

Commit straight/versions/default.el and straight-purifier.lock.json. Your configuration still uses straight-use-package. The wrapper activates Nix-built packages before loading your init file. Existing native checkouts remain available for ordinary Emacs outside the wrapper.

Without a lockfile, the wrapper warns and runs ordinary, impure Emacs. A damaged or stale lock fails with a repair command. You can install the wrapper through your normal Nix configuration.

A native integration is also available. Install it through Straight:

(straight-use-package
 '(straight-purifier
   :type git :host github
   :repo "nix-purifiers/straight-purifier"
   :files ("lisp/*.el")))
(require 'straight-purifier)
(straight-purifier-activate)

Place activation before your other package declarations. This integration warns that its own resolution was impure; the wrapper resolves the integration through Nix and activates it before user initialization.

Version compatibility

Tool or language Packaged defaults Tested versions
Straight bootstrap revision 3ad4414072ba512e39e19e8a7101bdfcb8318410 (new-project bootstrap) —
Emacs 31.1 —

Operating systems and architectures

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

Choosing versions

Component Selected by
Build tool / package manager: Straight Existing projects select their Straight revision through their native version pins.
straight/versions/default.el

Requirements

Development loop

After changing your configuration:

straight-purifier --project . lock
straight-purifier --project . prefetch
emacs --init-directory "$PWD"

lock keeps existing native commits, including when upstream branches move. Repeating it without changes preserves lockfile bytes. Update all packages and recipe repositories with:

straight-purifier --project . update
straight-purifier --project . prefetch

Or update one package:

straight-purifier --project . update s

Straight performs native resolution, dependency discovery, freezing and updates in a private profile. The companion records Git URLs, NAR hashes, commit metadata, normalized recipes and configuration fingerprints. Native commit coordinates remain in straight/versions/default.el.

Using locked dependencies

Locked, Nix-resolved packages for Emacs configurations using Straight.

Working offline

Run prefetch while inputs are available, then use Emacs normally. It roots the complete package environment and Emacs toolchain beside the selected lock. Packages are built with native Straight during the Nix build. Runtime Straight activation uses its safe mode and rejects cloning, fetching and native lock mutations.

All local .el configuration files are fingerprinted. Generated Straight checkouts and caches are excluded. Keep configuration imports within the configuration directory so they participate in the lock.

Language tooling integration

The same environment supplies package autoloads, bytecode and source. Normal find-function, help and completion use those packages. The sandbox editor test follows a real function definition into its Nix store source.

Nix builds

For an optional sandbox check or configuration release, add this flake to your project inputs and call its scoped builder:

pkgs.straight-purifier.buildStraightProject {
  src = ./.;
  testFile = ./tests.el;
}

Apply inputs.straight-purifier.overlays.default to your package set. The result exposes packages.environment, tests, release and fetches. testFile contains ERT tests. Without one, the builder activates every locked recipe. release contains a deterministic configuration archive. The builder also accepts external lockFile, nativeLock, configFile, fetchers, nativeBuildInputs and srcFilter arguments.

Supported scope

Supported language repositories

Straight Git recipes and their Git-backed recipe repositories are locked at native commits. Repository submodules and commit identity are retained. Private transport requires appropriate fetcher overrides; credentials do not belong in lockfiles. The CLI uses your native Git transport.

Git is the native plugin publication mechanism. GitHub Pages hosts the documentation. The flake targets x86_64 and ARM Linux.

Target systems

  • x86_64-linux
  • aarch64-linux

Troubleshooting

The default configuration is init.el, or packages.el for standalone package declarations. --config selects another file. Multiple Straight profiles, local-only recipes, and non-Git version-control backends are not supported yet. Custom package build commands must work in the Nix sandbox.

External native and companion locks are supported:

straight-purifier --project . \
  --native-lock ../locks/versions.el \
  --lockfile ../locks/straight.json lock
straight-purifier --project . \
  --native-lock ../locks/versions.el \
  --lockfile ../locks/straight.json prefetch

Set STRAIGHT_PURIFIER_NATIVE_LOCKFILE and STRAIGHT_PURIFIER_LOCKFILE for wrapper invocations using those external locks.

Examples

examples/config is a complete configuration using s.el, with its native versions file and companion lock.