Nixfmt

Serokell designed an open-source Nix formatter that allows to enhance code consistency, streamline the development process, and improve Nix code readability.

Nixfmt is a tool we created to provide the developer community with a high-quality code formatter for Nix. Anyone can download Nixfmt under the free REUSE 3.0 license.

What is Nixfmt Formatter?

When multiple developers work on the same project, disparities in coding styles can lead to confusion and potential errors. Nixfmt alleviates these challenges by automating the process of aligning code to a unified style, fostering clarity and best practices in programming.

Nixfmt by Serokell ensures that the code remains clear, concise, and consistent, aiding Nix programmers to streamline their development process and minimize errors.

Nix Facets

Nix Package Manager

Often just called "Nix", it's a powerful package manager for Linux and Unix systems that makes package management reliable. It allows multiple versions of software to coexist and ensures that builds and deployments are reproducible. It uses a purely functional language to describe packages and system configurations.

NixOS

NixOS is a Linux distribution that uses the Nix package manager. One of its key features is the way system configurations are described using Nix expressions. This allows programmers to recreate the same configuration on other machines or roll back to a previous state simply by switching to an earlier version of the Nix expressions.

Nixfmt Features

Whitespace management

Automates spaces and line breaks for consistency.

Indentation

Ensures proper alignment for nested blocks and structural elements.

Handling large codebases

Optimized for rapid processing of large Nix codebases.

Performance

Minimal latency even for large projects.

Preservation of logic

Parsing ensures code appearance is adjusted without altering the underlying logic.

Access Serokell’s open-source Nix formatter

Nixfmt Online Demo

Press Format! to see results

Results

Serokell is committed to contributing to open-source projects that promote wider adoption of functional languages and enhance the overall quality of complex software development. As a major achievement, Nixfmt has been included in the official library of the Nix package manager.

We invite enthusiasts to share their feedback and contribute to Nixfmt, as well as other open-source Serokell projects, on GitHub.

Download Nix formatter

Take a look and share with your colleagues.

Let’s Have a Chat

We would be happy to discuss your project and propose solutions.

Contact us