fourmolu-nix options

The following options can be set in a flake-parts configuration.

If you want to use lib, you don't need fourmolu. part of options.

{
  settings = {
    indentaion = 4;
  };
}

fourmolu.package

fourmolu derivation to use.

Type: package

Default: pkgs.haskellPackages.fourmolu

fourmolu.devShell

A development shell with fourmolu installed.

Type: package (read only)

fourmolu.settings

fourmolu configuration

Type: submodule

Default: { }

fourmolu.settings.column-limit

Max line length for automatic line breaking

Type: value “none” (singular enum) or (positive integer, meaning >0)

Default: "none"

Example: 80

fourmolu.settings.comma-style

How to place commas in multi-line lists, records, etc.

Type: one of “trailing”, “leading”

Default: "leading"

fourmolu.settings.extensions

List of ghc extensions to pass to fourmolu

Type: list of string

Default: [ ]

fourmolu.settings.function-arrows

Styling of arrows in type signatures

Type: one of “trailing”, “leading”, “leading-args”

Default: "trailing"

Example: "leading"

fourmolu.settings.haddock-style

How to print Haddock comments

Type: one of “single-line”, “multi-line”, “multi-line-compact”

Default: "multi-line"

fourmolu.settings.haddock-style-module

How to print module docstring

Type: one of “single-line”, “multi-line”, “multi-line-compact”

Default: "multi-line"

fourmolu.settings.import-export-style

Styling of import/export lists

Type: one of “trailing”, “leading”, “diff-friendly”

Default: "diff-friendly"

Example: "leading"

fourmolu.settings.in-style

How to align the ‘in’ keyword with respect to the ‘let’ keyword

Type: one of “right-align”, “left-align”, “no-space”

Default: "right-align"

fourmolu.settings.indent-wheres

Whether to full-indent or half-indent ‘where’ bindings past the preceding body

Type: boolean

Default: false

fourmolu.settings.indentation

Number of spaces per indentation step

Type: positive integer, meaning >0

Default: 2

Example: 4

fourmolu.settings.let-style

Styling of let blocks

Type: one of “auto”, “inline”, “newline”, “mixed”

Default: "auto"

fourmolu.settings.newlines-between-decls

Number of spaces between top-level declarations

Type: positive integer, meaning >0

Default: 1

fourmolu.settings.options

Fourmolu options to pass to wrapped fourmolu

Type: list of string

Default: [ ]

fourmolu.settings.record-brace-space

Whether to leave a space before an opening record brace

Type: boolean

Default: false

fourmolu.settings.respectful

Give the programmer more choice on where to insert blank lines

Type: boolean

Default: true

fourmolu.settings.single-constraint-parens

Whether to put parentheses around a single constraint

Type: one of “auto”, “always”, “never”

Default: "always"

fourmolu.settings.unicode

Output Unicode syntax

Type: one of “detect”, “always”, “never”

Default: "never"

fourmolu.wrapper

The fourmolu package, wrapped with the settings as arguments.

Type: package (read only)

Default: wrapped fourmolu command