nix-validation

Validate Nix expressions with treefmt, statix, and deadnix.

1|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/aytordev/system --skill nix-validation-aytordev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nix-validation
Source: https://github.com/aytordev/system/tree/main/modules/common/ai-tools/skills/nix/validation
Command: npx skills add https://github.com/aytordev/system --skill nix-validation-aytordev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Nix projects often suffer from inconsistent validation, brittle tooling, and hidden configuration errors. This skill provides a structured approach to validate Nix expressions, enforce formatting, and catch issues early.

Core Features & Use Cases

  • Automated Tools integration (treefmt, statix, deadnix) to format, lint, and prune dead code.
  • Manual Checks for dry-run builds and syntax validation in CI and local development.
  • Use Case: Apply to NixOS/Nixpkgs configurations and Home Manager setups to maintain reliable, auditable Nix configurations.

Quick Start

Run the validation suite against your Nix project to ensure expressions conform to standards.

Frequently Asked Questions about nix-validation

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

FAQPage Schema
How do I validate Nix code in a CI pipeline?

Validate Nix code in CI by running automated linting tools and manual dry-run checks to ensure correctness and compliance. This generates a structured validation report for your Nixpkgs configurations.

What is the best way to lint NixOS configurations?

Lint NixOS configurations by applying automated tools like treefmt, statix, and deadnix to format expressions, catch errors, and prune dead code. This ensures reliable and auditable Nix setups.

Can I use this validation approach with Home Manager setups?

Yes, you can validate Home Manager setups by running automated linting and manual syntax checks against the configurations. This enforces formatting standards and catches hidden configuration errors early.

How does automated Nix expression linting work?

Automated Nix expression linting works by integrating tools like treefmt, statix, and deadnix to scan code for errors, enforce formatting standards, and prune dead code. This catches configuration issues early.

Why does my Nixpkgs validation fail during dry-run builds?

Nixpkgs validation fails during dry-run builds when syntax errors or non-compliant formatting exist in the expressions. Running manual checks alongside automated linting identifies these hidden configuration errors.