nix-linting

Automate Nix linting and static analysis with statix, deadnix, and nixfmt.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Statix, deadnix, nixfmt, treefmt, nom, and nix-instantiate require manual orchestration to lint and format Nix code; this skill provides a consolidated guide to perform Nix linting, formatting, and static analysis consistently across projects.

Core Features & Use Cases

  • statix: check and fix anti-patterns and style issues
  • deadnix: detect dead code and provide --edit for automated cleanup
  • nixfmt: canonical Nix formatter for consistent code style
  • treefmt-nix: multi-formatter orchestration to run several formatters in one pass
  • nom: real-time build progress display for Nix projects
  • nix-instantiate: parse/evaluate Nix expressions for syntax validation
  • nix flake check: perform flake-level evaluation and checks
  • devenv pre-commit hooks: integrate linting into pre-commit workflows
  • CI integration: guidelines for format check, lint, and build in CI

Quick Start

Run statix check . to begin linting your Nix project.

Frequently Asked Questions about nix-linting

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

FAQPage Schema
How do I run statix and deadnix to lint a Nix project?▼

Run statix check . to identify style issues and anti-patterns, then use deadnix to detect unused code, applying the --edit flag for automated cleanup across your Nix project.

What is the best way to format Nix code and run multiple formatters in one pass?▼

The best way to format Nix code is using nixfmt as the canonical formatter, orchestrated with treefmt-nix to run multiple formatters in a single pass and ensure consistent code style across the project.

How do I integrate Nix linting into pre-commit hooks and CI workflows?▼

Integrate Nix linting into pre-commit hooks using devenv, and apply the provided CI guidelines to automate format checks, run statix and deadnix, and evaluate builds within your CI workflows.

Can I use nix-instantiate and nix flake check for static analysis and syntax validation?▼

Yes, you can use nix-instantiate to parse and evaluate Nix expressions for syntax validation, and run nix flake check to perform flake-level evaluation and checks for static analysis.

Does treefmt support configuration for statix and nixfmt?▼

Yes, treefmt-nix supports multi-formatter orchestration to run formatters like nixfmt and linters like statix together, and you can further customize statix behavior using a statix.toml configuration file.