nix-debugging

Diagnose Nix evaluation and build failures with targeted debugging techniques.

1|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/Jylhis/claude-marketplace --skill nix-debugging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nix-debugging
Source: https://github.com/Jylhis/claude-marketplace/tree/main/plugins/nix-dev/skills/nix-debugging
Command: npx skills add https://github.com/Jylhis/claude-marketplace --skill nix-debugging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers rapidly diagnose and resolve Nix evaluation and build failures by consolidating common error patterns and targeted debugging techniques. It reduces time spent chasing obscure evaluation errors, infinite recursion, hash mismatches, import-from-derivation issues, collision errors, and unexpected closure size or store path problems.

Core Features & Use Cases

  • Evaluation and Recursion Diagnosis: Techniques to locate sources of infinite recursion and attribute-missing errors using tracing and careful overlay usage.
  • Build and Hash Recovery: Guidance on resolving fixed-output derivation hash mismatches, handling unfree packages, and avoiding IFD by prefetching or adjusting fetchers.
  • Closure, Logs, and Dependency Analysis: Use cases for nix log, nix why-depends, nix path-info, and store inspection to find unexpected dependencies, large closures, and to interpret build logs for fixes.
  • Real-world Example: When an overlay causes infinite recursion or a package fails with a hash mismatch, the Skill walks through using builtins.trace, nix eval, and build debugging steps to isolate and fix the root cause.

Quick Start

Ask the skill to analyze a Nix evaluation or build error and produce targeted debugging steps.

Frequently Asked Questions about nix-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug infinite recursion in a Nix overlay?

To debug infinite recursion in a Nix overlay, use builtins.trace and nix eval to locate the repeating attribute access. Careful overlay construction and tracing isolate the exact evaluation cycle causing the failure.

Why does my Nix build fail with a fixed-output derivation hash mismatch?

A Nix hash mismatch occurs when fetched sources change or hashes are outdated. Resolve it by prefetching sources, updating hashes, or adjusting fetchers to avoid import-from-derivation issues.

What is the best way to find unexpected dependencies in a Nix closure?

The best way to find unexpected dependencies in a Nix closure is using nix why-depends and nix path-info. These commands identify what pulls in unwanted store paths and reduce closure size.

How do I inspect a Nix build log to fix an evaluation error?

To inspect a Nix build log and fix evaluation errors, use nix log to retrieve output and nix repl to interactively evaluate expressions. This isolates missing attributes or failing logic.

Can I troubleshoot NixOS unfree package issues without disabling garbage collection?

Yes, you can troubleshoot unfree package issues by configuring allowUnfree in your NixOS configuration while using targeted garbage collection strategies. This retains required store paths during debugging.

When should I use nix eval instead of building a derivation to test Nixpkgs?

Use nix eval instead of a full build to test Nixpkgs when checking attribute structure or tracing evaluation logic. It surfaces missing attributes or infinite recursion without building outputs.