nixfmt: An opinionated formatter for Nix

[ development, library, mpl ] [ Propose Tags ]

A formatter for Nix that ensures consistent and clear formatting by forgetting all existing formatting during parsing.


[Skip to Readme]
Versions [faq] 0.3.0
Change log CHANGELOG.md
Dependencies base (>=4.12.0 && <4.13), cmdargs (>=0.10.20 && <0.11), directory (>=1.3.3 && <1.4), filepath (>=1.4.2 && <1.5), ghcjs-base (>=0.2.0 && <0.3), megaparsec (>=7.0.5 && <7.1), nixfmt, parser-combinators (>=1.0.3 && <1.3), safe-exceptions (>=0.1.7 && <0.2), text (>=1.2.3 && <1.3), unix (>=2.7.2 && <2.8) [details]
License MPL-2.0
Copyright 2019 Serokell, 2019 Lars Jellema
Author Lars Jellema
Maintainer lars.jellema@gmail.com
Category Development
Home page https://github.com/serokell/nixfmt
Bug tracker https://github.com/serokell/nixfmt/issues
Source repo head: git clone git://github.com/serokell/nixfmt.git
Uploaded by LarsJellema at Thu Aug 29 12:53:31 UTC 2019
Distributions NixOS:0.3.0
Executables js-interface, nixfmt
Downloads 40 total (15 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2019-08-29 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for nixfmt-0.3.0

[back to package description]
<!-- © 2019 Serokell <hi@serokell.io> - © 2019 Lars Jellema <lars.jellema@gmail.com> - - SPDX-License-Identifier: MPL-2.0 -->

nixfmt

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

Installation

  • Optional: cachix use nixfmt
  • nix-env -f https://github.com/serokell/nixfmt/archive/master.tar.gz -i

Development

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

Usage

  • 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 :heart: 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!