The official formatter for Nix language code, enforcing a standard artistic formatting style.
Nixfmt is the official code formatter for the Nix language. It automatically formats Nix code to comply with a standard artistic style defined by the Nix community, ensuring consistency across projects. It solves the problem of inconsistent formatting in Nix codebases, making code more readable and maintainable.
Nix developers and teams working on Nix projects who want to enforce a consistent code style automatically. It's particularly useful for collaborative environments where multiple contributors edit Nix files.
Developers choose Nixfmt because it's the officially maintained formatter for Nix, providing a single source of truth for formatting rules. It integrates seamlessly with popular editors, Git hooks, and project tooling, reducing configuration overhead and ensuring adherence to community standards.
The official formatter for Nix code
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Maintained by the Nix formatting team, it enforces the community-defined artistic formatting from standard.md, eliminating style debates in collaborative projects.
Works with popular editors like neovim (via nixd, nil, none-ls) and VSCode through extensions, making it easy to incorporate into daily workflows.
Includes a --mergetool mode for resolving formatting-related conflicts and supports pre-commit hooks via git-hooks.nix or direct configuration, automating checks.
Easily installable via NixOS, Home Manager, and declarative shells, and integrates with project tools like treefmt-nix and nix fmt for flakes.
The core tool can only process one file at a time, requiring external wrappers like treefmt for project-wide formatting, as noted in the README.
Installation and use are tied to the Nix package manager, which can be a hurdle for developers not already in the Nix ecosystem or using other OSes.
Formats strictly to the community standard with no built-in options to adjust rules, which may not suit teams preferring different styles.