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]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.3.0, 0.4.0, 0.5.0, 0.6.0
Change log CHANGELOG.md
Dependencies base (>=4.12.0 && <4.14), 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 && <8.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
Revised Revision 1 made by LarsJellema at 2020-03-13T16:56:08Z
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 gromak at 2020-02-10T15:10:26Z
Distributions NixOS:0.6.0
Executables js-interface, nixfmt
Downloads 1164 total (25 in the last 30 days)
Rating 1.75 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-02-10 [all 1 reports]

Readme for nixfmt-0.4.0

[back to package description]

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

  • nixfmt is in nixpkgs master as of 2019-09-04:

    nix-env -iA nixpkgs.nixfmt
    
  • To get the most recent version, install from master:

    # Optional: use cachix to get cached builds even for master
    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 built 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 ❤️ 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!