Automatically order function arguments consistently across a NixOS configuration.
Reorder attributes while keeping their comments attached to the right line.
Preview how a Nix file would be reformatted without modifying it, using the run command.
Turn on optional features like ordering let bindings or merging repeated keys for stricter formatting.
| swarsel/pedantix | avelino/mcp | mitsuhiko/insta-cmd | |
|---|---|---|---|
| Stars | 52 | 52 | 52 |
| Language | Rust | Rust | Rust |
| Last pushed | — | — | 2026-06-14 |
| Maintenance | — | — | Maintained |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 3/5 | 2/5 |
| Audience | developer | ops devops | developer |
Figures from each repo's GitHub metadata at analysis time.
Runs directly via `nix run github:Swarsel/pedantix` with no separate install step.
pedantix is a formatter for the Nix configuration language, focused specifically on cleaning up ordering issues that regular Nix formatters do not touch. The author built it after being frustrated with inconsistently ordering module arguments across a NixOS configuration, where some functions listed lib, config, pkgs in one order and others listed them differently, and after growing tired of a similar warning from another tool called statix about repeated keys. Rather than replacing your existing formatter, pedantix is designed to work alongside whichever one you already use, and it has been tested with nixfmt, alejandra, and nixpkgs-fmt. It focuses only on reordering things: function arguments and attribute ordering, since the author reasons that custom ordering of attributes rarely matters in the Nix language except in specific cases like let bindings. By default, pedantix turns on two behaviors: ordering function arguments consistently, and ordering attributes while keeping any comment blocks correctly attached to the line they were commenting on. A number of additional behaviors exist but are turned off by default, including ordering of inherits, ordering of let bindings, ordering of lists, merging repeated keys, flattening single entry attribute sets, enforcing blank lines between attribute sets, and custom ordering overrides for specific attribute paths. The README notes that merging repeated keys does not fix a file that fails to evaluate, it only tidies duplicate entries. You can try it without installing anything or modifying your files by running it directly with Nix's run command, piping a Nix file into it to preview how it would be reformatted. Full documentation, including details on customizing which features are enabled, is hosted on a separate documentation site linked from the README.
A formatter for the Nix language that fixes ordering of function arguments and attributes, working alongside your existing Nix formatter.
Mainly Rust. The stack also includes Rust, Nix.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.