nixfmt
« Back to VersTracker
Description:
Command-line tool to format Nix language code
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: nix formatter developer-tools cli code-style
Install: brew install nixfmt
About:
Nixfmt is a command-line interface tool designed to format Nix language files according to a consistent style. It parses Nix expressions and re-outputs them with standardized indentation and layout, making code easier to read and maintain. This tool helps enforce uniformity across Nix projects, reducing time spent on manual formatting during code reviews.
Key Features:
  • Idempotent formatting: Running the tool multiple times produces the same output
  • Standard compliance: Adheres to the official Nix language syntax
  • CLI integration: Works with stdin/stdout for easy editor and CI integration
  • Fast execution: Optimized for large Nix files and repositories
Use Cases:
  • Enforcing consistent code style in Nixpkgs and other Nix-based projects
  • Automating formatting in CI/CD pipelines to prevent style drift
  • Quickly reformatting legacy or manually written Nix files
Alternatives:
  • nixpkgs-fmt – Another popular Nix formatter with slightly different style choices; nixfmt is often preferred for its strict adherence to a unified style.
  • alejandra – A newer formatter focusing on speed and a unique formatting algorithm; nixfmt is more established and widely used in the official Nix ecosystem.
Version History
Detected Version Rev Change Commit
Sep 16, 2025 5:08pm 0 VERSION_BUMP 101d4d38