← Catalog

pi-nix-build

pi extension for Nix builds with live progress

Package

Install

Install with PiG

pig install npm:pi-nix-build

Install with Pi

pi install npm:pi-nix-build
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./dist/index.mjs"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.1 (README.md). PiG does not review it.

pi-nix-build

English | 简体中文

A pi extension for Nix builds and evaluation with live progress, failure diagnostics, and background job monitoring.

Showcase

Live Progress Widget

Displays evaluation progress, dependency tree, stdenv phases, remote builder hosts, duration estimates, active transfers, and Ctrl+Shift+B compact collapse above the editor.

Live progress widget

Fullscreen Detail View (Ctrl+Shift+M)

Inspects every derivation in the dependency forest alongside its build log, with auto-follow pause/resume (↓ N newer lines) and keyboard or mouse navigation.

Fullscreen detail view

Failure Diagnostics & Hash Mismatch

Surfaces failed derivations, trailing log lines, dependency blocks (⊘), and fixed-output hash mismatches (specified vs got).

Failure diagnostics and hash mismatch

Features

  • Live build progress: Displays evaluation status, dependency trees, build phases, remote builders, and estimated build times above the editor.
  • Fullscreen detail view: Inspects all derivations and their captured logs during or after a build.
  • Flake and non-flake support: Supports nix build (flake installables), nix-build (files, expressions, and attribute paths), and nix flake check (nix_check).
  • Nix evaluation: nix_eval returns values from nix eval or nix-instantiate --eval, as JSON by default, with Nix's error trace on failure and live progress when evaluation fetches sources or builds derivations.
  • Failure diagnostics: Reports failed derivations with the error part of their logs, fixed-output hash mismatches, and evaluation errors. Notes when a failure repeats an earlier one unchanged.
  • Build logs: nix_log reads or searches the log of any derivation built in the session, or of a store path through nix log.
  • Background builds and watches: Runs long builds and flake checks in the background with event notifications, and registers jobs in /ps when pi-processes is loaded.
  • Command redirection: Intercepts nix build, nix-build, and nix flake check invocations in shell and process tools, routing them through nix_build or nix_check.

Requirements

  • pi
  • Node.js >= 22.19.0
  • nix / nix-build / nix-instantiate on PATH
  • A Nerd Font in the terminal for the icons, or PI_NIX_BUILD_NERD_FONT=0 for plain Unicode symbols

Installation

Using pi

# Install from npm
pi install npm:pi-nix-build

# Or install from GitHub
pi install git:github.com/Moraxyc/pi-nix-build

# Try for a single session without installing
pi -e npm:pi-nix-build

Using Nix

nix build github:Moraxyc/pi-nix-build

Load ./result/lib/node_modules/pi-nix-build with pi -e, or add it to pi's packages configuration.

From source

npm ci
npm run build
pi install .

Usage

After installation, ask pi to build or evaluate as usual:

  • "Build the default package in this flake"
  • "Run nix flake check with --keep-going"
  • "Build attribute hello from default.nix"
  • "Run this build in the background and notify me if any derivation fails"
  • "Which version of hello does nixpkgs have?"
  • "List the attribute names of .#packages.x86_64-linux"

Shortcuts

ShortcutAction
Ctrl+Shift+BCollapse or expand the live progress widget; with several builds, expand each in turn
Ctrl+Shift+MOpen the fullscreen detail view for the expanded or latest build

Documentation

License

MIT