Automic VaultAutomic Vault

brew

Install nixfmt with Homebrew, Nix

Command-line tool to format Nix language code. Version 1.4.0 via Homebrew; verified 2026-07-08.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install nixfmt

local Homebrew formula metadata

Linux

Nixverified · 92%
nix profile install nixpkgs#nixfmt

nixpkgs package indexes · pkgs/by-name/ni/nixfmt/package.nix · source: api.github.com

overview

Package summary

Command-line tool to format Nix language code

Commands and aliases

  • nixfmt

history

Project history and usage

nixfmt is the official formatter for Nix language code. It started as a formatter project, was donated into the NixOS organization, and became the reference implementation for the standard Nix format defined by RFC 166.

Project history

The nixfmt changelog lists version 0.1.0 on May 11, 2019 as the first release and says it could parse all of nixpkgs and format it consistently, though not yet prettily in all places. The repository README later acknowledged that nixfmt was originally developed by Serokell and donated to become an official Nix project after RFC 166.

RFC 166 was merged on March 5, 2024. The RFC text on the pull request set out to define the initial standard Nix format, establish the Nix formatter team, create the official implementation, reformat Nixpkgs, and require default formatting in the Nix CLI to use the official formatter. nixfmt 1.0.0 was released on July 9, 2025 as the first stable release of the official formatter, with the changelog noting that formatting changed substantially from earlier nixfmt output.

Adoption history

nixfmt's adoption is institutional inside the Nix ecosystem rather than measured only by direct installs. The README calls it the official formatter, says the standard is defined in `standard.md`, and documents editor integration, NixOS/Home Manager installation, `nixfmt-tree`, `treefmt-nix`, direct `treefmt`, and `git-hooks.nix` workflows.

On 2026-07-01, Homebrew listed nixfmt 1.3.1 with 1,388 installs over 365 days. That undercounts its real ecosystem role because many Nix users get it from Nixpkgs and invoke it through flakes, `nix fmt`, treefmt wrappers, editor integrations, or pre-commit hooks.

How it is used

The bare CLI is simple: `nixfmt < input.nix` formats stdin to stdout, and `nixfmt file.nix` formats a file in place. The README notes that `nixfmt` itself processes one file at a time and points project-level users toward wrappers such as `nixfmt-tree`, `treefmt-nix`, `treefmt`, and `git-hooks.nix`.

For flake-based workflows, the Nix manual documents `nix fmt` as rewriting Nix files to a canonical format using the formatter specified in the flake, including examples that set the formatter to `nixfmt`. That is the package-nerd adoption path: wire nixfmt into the flake, editor, or pre-commit hook and stop arguing about style.

Why package nerds care

nixfmt matters because Nix formatting moved from preference and competing tools toward a source-backed standard with a maintained official implementation. For package databases, it is a clean example of a developer tool whose status changed through governance: Serokell project, RFC-defined standard, NixOS-org repository, then official stable formatter.

Timeline

  • {'date': '2019-05-11', 'event': 'nixfmt 0.1.0 first release.'}
  • {'date': '2024-03-05', 'event': 'RFC 166 merged.'}
  • {'date': '2025-07-09', 'event': 'nixfmt 1.0.0 released as the first stable official formatter.'}
  • {'date': '2026-07-01', 'event': 'Homebrew formula listed stable nixfmt 1.3.1.'}

Related projects

  • Nix
  • Nixpkgs
  • nixfmt-tree
  • treefmt
  • treefmt-nix
  • git-hooks.nix

security posture

Risk level: green

narrow executable package without higher-risk signals.

Risk classifier

green risk · low confidence · appliance

Why

  • narrow executable package without higher-risk signals

Signals

  • metadata:no-higher-risk-signals

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 6 platform targets.
  • Installs with 1 runtime dependencies.
  • Build metadata lists 2 build dependencies.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

executables

Installed executables

CommandKindExposureNote
nixfmtcliglobal executable

freshness

Version and freshness

These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.

page generated2026-07-08
manager version1.4.0
manager updated2026-07-08
local dataok
upstreamcurrent
latest detectedv1.4.0

https://github.com/NixOS/nixfmt

  • okNo freshness warnings were generated.

install metadata

Package metadata

Package keybrew:nixfmt
Version1.4.0
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/nixfmt
Homepagehttps://github.com/NixOS/nixfmt
Repositoryhttps://github.com/NixOS/nixfmt
Upstream docshttps://github.com/NixOS/nixfmt#readme
LicenseMPL-2.0
Source archivehttps://github.com/NixOS/nixfmt/archive/refs/tags/v1.4.0.tar.gz
Last updated2026-07-08T03:18:41Z
Pulseupdated
Dependenciesgmp
Build dependenciescabal-install, ghc
Uses from macOSlibffi
Bottleavailable (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namenixfmt
Version Scheme0
Revision0
Head VersionHEAD
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • head
  • stable

source database matches

Other package-manager records

Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.

Nix95%

nixfmt

nix profile install nixpkgs#nixfmt
  • normalized package name match
  • Matched by: Nixfmt
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/ni/nixfmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment