# NixOS/nixfmt

The official formatter for Nix code

Repository: https://github.com/NixOS/nixfmt
Canonical: https://ross.abutalabs.com/products/nixfmt
Language: Haskell
License: MPL-2.0
License Family: copyleft
Topics: nix, formatter, haskell
Last push: 2026-08-25T20:23:57+00:00

## Health v2 (maintenance only)
Score: 93/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 80, longevity 100
- inputs: {"age_days": 2953, "days_push": 8, "days_rel": 57, "gap_med": 50.0, "n_releases_24m": 7}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1593, forks 77 (observed 2026-08-28T04:05:08.924051+00:00)

## What it is
Nixfmt is the official formatter for the Nix language, implementing the standard Nix format. It is a command-line tool written in Haskell, maintained by the Nix formatting team, and integrates with editors and treefmt.

## Use cases
- format nix code automatically
- enforce consistent nix formatting in a project
- integrate nix formatting into neovim or vscode
- format nix files with treefmt
- standardize code style across a nix codebase

## When to choose
- you write Nix code and want the official standard format
- you need editor integration for formatting Nix files
- you want consistent formatting enforced across a NixOS or nix project

## When to avoid
- you need a formatter for languages other than Nix
- you prefer a different Nix formatting style such as alejandra or nixpkgs-fmt

## Facets
- artifact type: cli-tool
- maturity: stable
- function: formatter, cli, developer-tools
- domain: developer-tools, programming-languages
- platform: cross-platform, cli
- tags: nix, code-formatting, haskell, nixos, command-line, linux, macos

## Member repositories
- NixOS/nixfmt (main) score 93

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:08.924051+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:54:14.063284+00:00, confidence not recorded.
  - readme: https://github.com/NixOS/nixfmt (fetched 2026-08-28T04:05:08.924051+00:00, sha 7e16a1e7ac8a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
