nix-validation

Validate Nix configurations with treefmt-nix, statix, and deadnix checks.

340|18|Updated May 11, 2023
One-click install
npx skills add https://github.com/khaneliman/khanelinix --skill nix-validation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nix-validation
Source: https://github.com/khaneliman/khanelinix/tree/main/modules/common/ai-tools/skills/nix-validation
Command: npx skills add https://github.com/khaneliman/khanelinix --skill nix-validation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Validates Nix configurations end-to-end by running formatting, linting, and integrity checks to reduce syntax errors, anti-patterns, and misconfigurations across a codebase.

Core Features & Use Cases

  • Integrated validation workflow including treefmt-nix formatting, statix linting, and deadnix analysis to catch issues early.
  • Flake and module validation for NixOS, home-manager, and darwin configurations, with project-specific pattern enforcement.
  • Use case: when preparing a NixOS upgrade or new module, run the validation suite to ensure correctness and consistency across the repository.

Quick Start

Run a full validation by executing a flake check at the repository root to run all checks.

Frequently Asked Questions about nix-validation

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

FAQPage Schema
How do I validate NixOS module configurations and fix syntax errors?

To validate NixOS module configurations and fix syntax errors, run a full validation suite including treefmt-nix formatting, statix linting, and deadnix analysis. This identifies misconfigurations and anti-patterns across the repository to ensure correctness.

What's the best way to run flake checks for Nix anti-patterns before a NixOS upgrade?

The best way to run flake checks for Nix anti-patterns is executing a flake check at the repository root. This triggers an integrated validation workflow catching formatting issues, linting violations, and dead code before a NixOS upgrade.

Can I use statix and deadnix linting with home-manager setups?

Yes, you can use statix and deadnix linting with home-manager setups. The validation toolkit supports flake and module validation specifically for NixOS, home-manager, and darwin configurations to enforce project-specific patterns.

Does treefmt-nix formatting support pre-commit checks and CI integration?

Yes, treefmt-nix formatting supports pre-commit checks and CI integration. The toolkit guides validation during development, CI, or pre-commit hooks to catch syntax errors and misconfigurations early across Nix-based projects.

Why does my Nix flake check fail with syntax errors and misconfigurations?

Nix flake checks fail with syntax errors and misconfigurations due to anti-patterns in the codebase. Running integrated validation including statix linting and deadnix analysis identifies and helps fix these issues to reduce end-to-end errors.