Skip to content
A formatter for Nix code
Haskell HTML Nix JavaScript
Branch: master
Clone or download
Latest commit 4f827df Aug 12, 2019


nixfmt is a formatter for Nix code, intended to easily apply a uniform style.

You are encouraged to test this out on your code and submit any undesirable formatting you find as an issue

Build Status Cachix


  • Optional: cachix use nixfmt
  • nix-env -f -i


With Nix

Haskell dependencies will be built by Nix.

  • Enter nix-shell
  • Build with cabal new-build

Without Nix

Haskell dependencies will be bulit by Cabal.

  • Build with cabal new-build


  • nixfmt < input.nix – reads Nix code form stdin, formats it, and outputs to stdout
  • nixfmt file.nix – format the file in place

For Contributors

We welcome issues and pull requests on GitHub.

About Serokell

nixfmt is maintained and funded with ❤️ by Serokell. The names and logo for Serokell are trademark of Serokell OÜ.

We love open source software! See our other projects or hire us to design, develop and grow your idea!

You can’t perform that action at this time.