# Nixpkgs Fmt

> Use this skill when the user wants to format Nix code, format nixpkgs expressions, or format NixOS configuration files.

- Skill: `javimosch/nixpkgs-fmt` (Agent Skill)
- Install (CLI): `npx skillmds@latest add javimosch/nixpkgs-fmt`
- Raw SKILL.md: https://api.skillmd.com/api/skills/javimosch/nixpkgs-fmt/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: javimosch (https://skillmd.com/u/javimosch)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/javimosch/nixpkgs-fmt

---


# nixpkgs-fmt Plugin

Nix code formatter for nixpkgs. Format Nix expressions and configurations according to nixpkgs style guidelines.

## Commands

### Nix Formatting
- `nixpkgs-fmt nix format` — Format Nix code

### Utility
- `nixpkgs-fmt _ _` — Passthrough to nixpkgs-fmt CLI

## Usage Examples
- "Format Nix code"
- "Format nixpkgs expression"
- "Format NixOS config"
- "Check Nix formatting"

## Installation

```bash
brew install nixpkgs-fmt
```

Or via Nix:
```bash
nix-env -iA nixpkgs.nixpkgs-fmt
```

## Examples

```bash
# Format Nix file
nixpkgs-fmt nix format default.nix

# Check without modifying
nixpkgs-fmt nix format default.nix --check

# Write changes
nixpkgs-fmt nix format default.nix --write

# Verify formatting
nixpkgs-fmt nix format default.nix --verify

# Any nixpkgs-fmt command with passthrough
nixpkgs-fmt _ _ default.nix
nixpkgs-fmt _ _ default.nix --check
```

## Key Features
- **Nixpkgs** - nixpkgs style guidelines
- **Format** - Nix code formatting
- **Check** - Check without changes
- **Verify** - Verify formatting
- **Standard** - Consistent style
- **NixOS** - NixOS configs
- **Fast** - Quick formatting
- **Easy** - Simple interface
- **Maintainers** - Package maintainers
- **Reliable** - Reliable output

## Notes
- Great for Nix package maintainers
- Follows nixpkgs style guide
- Perfect for NixOS configs
- Pre-commit hook support

