treefmt-nix

When working on large code trees, it's common to have multiple code formatters run against it. And have one script that loops over all of them. treefmt makes that nicer.

  • A unified CLI and output
  • Run all the formatters in parallel.
  • Cache which files have changed for super fast re-formatting.
  • Just type treefmt in any folder and it reformats the whole code tree.

This module is defined in numtide/treefmt-nix. The treefmt repo is about the tool itself.

Installation

To use these options, add to your flake inputs:

treefmt-nix.url = "github:numtide/treefmt-nix";

and inside the mkFlake:

imports = [
  inputs.treefmt-nix.flakeModule
];

Run nix flake lock and you're set.

Options

perSystem.treefmt

perSystem.treefmt.package

perSystem.treefmt.build.check

perSystem.treefmt.build.configFile

perSystem.treefmt.build.devShell

perSystem.treefmt.build.programs

perSystem.treefmt.build.wrapper

perSystem.treefmt.flakeCheck

perSystem.treefmt.flakeFormatter

perSystem.treefmt.programs.alejandra.enable

perSystem.treefmt.programs.alejandra.package

perSystem.treefmt.programs.asmfmt.enable

perSystem.treefmt.programs.asmfmt.package

perSystem.treefmt.programs.beautysh.enable

perSystem.treefmt.programs.beautysh.package

perSystem.treefmt.programs.beautysh.indent_size

perSystem.treefmt.programs.biome.enable

perSystem.treefmt.programs.biome.package

perSystem.treefmt.programs.biome.excludes

perSystem.treefmt.programs.biome.includes

perSystem.treefmt.programs.biome.settings.formatter.enabled

perSystem.treefmt.programs.biome.settings.formatter.formatWithErrors

perSystem.treefmt.programs.biome.settings.formatter.ignore

perSystem.treefmt.programs.biome.settings.formatter.include

perSystem.treefmt.programs.biome.settings.formatter.indentStyle

perSystem.treefmt.programs.biome.settings.formatter.indentWidth

perSystem.treefmt.programs.biome.settings.formatter.lineEnding

perSystem.treefmt.programs.biome.settings.formatter.lineWidth

perSystem.treefmt.programs.biome.settings.javascript.formatter.enabled

perSystem.treefmt.programs.biome.settings.javascript.formatter.arrowParentheses

perSystem.treefmt.programs.biome.settings.javascript.formatter.bracketSameLine

perSystem.treefmt.programs.biome.settings.javascript.formatter.bracketSpacing

perSystem.treefmt.programs.biome.settings.javascript.formatter.indentStyle

perSystem.treefmt.programs.biome.settings.javascript.formatter.indentWidth

perSystem.treefmt.programs.biome.settings.javascript.formatter.jsxQuoteStyle

perSystem.treefmt.programs.biome.settings.javascript.formatter.lineEnding

perSystem.treefmt.programs.biome.settings.javascript.formatter.lineWidth

perSystem.treefmt.programs.biome.settings.javascript.formatter.quoteProperties

perSystem.treefmt.programs.biome.settings.javascript.formatter.quoteStyle

perSystem.treefmt.programs.biome.settings.javascript.formatter.semicolons

perSystem.treefmt.programs.biome.settings.javascript.formatter.trailingComma

perSystem.treefmt.programs.biome.settings.javascript.globals

perSystem.treefmt.programs.biome.settings.javascript.parser.unsafeParameterDecoratorsEnabled

perSystem.treefmt.programs.biome.settings.json.formatter.enabled

perSystem.treefmt.programs.biome.settings.json.formatter.indentStyle

perSystem.treefmt.programs.biome.settings.json.formatter.indentWidth

perSystem.treefmt.programs.biome.settings.json.formatter.lineEnding

perSystem.treefmt.programs.biome.settings.json.formatter.lineWidth

perSystem.treefmt.programs.biome.settings.json.parser.allowComments

perSystem.treefmt.programs.biome.settings.json.parser.allowTrailingCommas

perSystem.treefmt.programs.biome.settings.organizeImports.enabled

perSystem.treefmt.programs.biome.settings.organizeImports.ignore

perSystem.treefmt.programs.biome.settings.organizeImports.include

perSystem.treefmt.programs.black.enable

perSystem.treefmt.programs.black.package

perSystem.treefmt.programs.buildifier.enable

perSystem.treefmt.programs.buildifier.package

perSystem.treefmt.programs.buildifier.includes

perSystem.treefmt.programs.cabal-fmt.enable

perSystem.treefmt.programs.cabal-fmt.package

perSystem.treefmt.programs.clang-format.enable

perSystem.treefmt.programs.clang-format.package

perSystem.treefmt.programs.cljfmt.enable

perSystem.treefmt.programs.cljfmt.package

perSystem.treefmt.programs.cljfmt.includes

perSystem.treefmt.programs.csharpier.enable

perSystem.treefmt.programs.csharpier.package

perSystem.treefmt.programs.csharpier.dotnet-sdk

perSystem.treefmt.programs.cue.enable

perSystem.treefmt.programs.cue.package

perSystem.treefmt.programs.deadnix.enable

perSystem.treefmt.programs.deadnix.package

perSystem.treefmt.programs.deadnix.no-lambda-arg

perSystem.treefmt.programs.deadnix.no-lambda-pattern-names

perSystem.treefmt.programs.deadnix.no-underscore

perSystem.treefmt.programs.deno.enable

perSystem.treefmt.programs.deno.package

perSystem.treefmt.programs.deno.excludes

perSystem.treefmt.programs.deno.includes

perSystem.treefmt.programs.dhall.enable

perSystem.treefmt.programs.dhall.package

perSystem.treefmt.programs.dhall.lint

perSystem.treefmt.programs.dprint.enable

perSystem.treefmt.programs.dprint.package

perSystem.treefmt.programs.dprint.settings.excludes

perSystem.treefmt.programs.dprint.settings.extends

perSystem.treefmt.programs.dprint.settings.includes

perSystem.treefmt.programs.dprint.settings.incremental

perSystem.treefmt.programs.dprint.settings.indentWidth

perSystem.treefmt.programs.dprint.settings.lineWidth

perSystem.treefmt.programs.dprint.settings.newLineKind

perSystem.treefmt.programs.dprint.settings.plugins

perSystem.treefmt.programs.dprint.settings.useTabs

perSystem.treefmt.programs.elm-format.enable

perSystem.treefmt.programs.elm-format.package

perSystem.treefmt.programs.erlfmt.enable

perSystem.treefmt.programs.erlfmt.package

perSystem.treefmt.programs.erlfmt.print-width

perSystem.treefmt.programs.fnlfmt.enable

perSystem.treefmt.programs.fnlfmt.package

perSystem.treefmt.programs.formatjson5.enable

perSystem.treefmt.programs.formatjson5.package

perSystem.treefmt.programs.formatjson5.indent

perSystem.treefmt.programs.formatjson5.noTrailingCommas

perSystem.treefmt.programs.formatjson5.oneElementLines

perSystem.treefmt.programs.formatjson5.sortArrays

perSystem.treefmt.programs.fourmolu.enable

perSystem.treefmt.programs.fourmolu.package

perSystem.treefmt.programs.fourmolu.ghcOpts

perSystem.treefmt.programs.fprettify.enable

perSystem.treefmt.programs.fprettify.package

perSystem.treefmt.programs.gofmt.enable

perSystem.treefmt.programs.gofmt.package

perSystem.treefmt.programs.gofumpt.enable

perSystem.treefmt.programs.gofumpt.package

perSystem.treefmt.programs.gofumpt.extra

perSystem.treefmt.programs.google-java-format.enable

perSystem.treefmt.programs.google-java-format.package

perSystem.treefmt.programs.hclfmt.enable

perSystem.treefmt.programs.hclfmt.package

perSystem.treefmt.programs.hlint.enable

perSystem.treefmt.programs.hlint.package

perSystem.treefmt.programs.isort.enable

perSystem.treefmt.programs.isort.package

perSystem.treefmt.programs.isort.profile

perSystem.treefmt.programs.jsonfmt.enable

perSystem.treefmt.programs.jsonfmt.package

perSystem.treefmt.programs.jsonnet-lint.enable

perSystem.treefmt.programs.jsonnet-lint.package

perSystem.treefmt.programs.jsonnetfmt.enable

perSystem.treefmt.programs.jsonnetfmt.package

perSystem.treefmt.programs.just.enable

perSystem.treefmt.programs.just.package

perSystem.treefmt.programs.keep-sorted.enable

perSystem.treefmt.programs.keep-sorted.package

perSystem.treefmt.programs.ktfmt.enable

perSystem.treefmt.programs.ktfmt.package

perSystem.treefmt.programs.ktlint.enable

perSystem.treefmt.programs.ktlint.package

perSystem.treefmt.programs.leptosfmt.enable

perSystem.treefmt.programs.leptosfmt.package

perSystem.treefmt.programs.mdformat.enable

perSystem.treefmt.programs.mdformat.package

perSystem.treefmt.programs.mdsh.enable

perSystem.treefmt.programs.mdsh.package

perSystem.treefmt.programs.mix-format.enable

perSystem.treefmt.programs.mix-format.package

perSystem.treefmt.programs.muon.enable

perSystem.treefmt.programs.muon.package

perSystem.treefmt.programs.mypy.enable

perSystem.treefmt.programs.mypy.directories

perSystem.treefmt.programs.mypy.directories.<name>.directory

perSystem.treefmt.programs.mypy.directories.<name>.extraPythonPackages

perSystem.treefmt.programs.mypy.directories.<name>.files

perSystem.treefmt.programs.mypy.directories.<name>.modules

perSystem.treefmt.programs.mypy.directories.<name>.options

perSystem.treefmt.programs.nickel.enable

perSystem.treefmt.programs.nickel.package

perSystem.treefmt.programs.nixfmt.enable

perSystem.treefmt.programs.nixfmt.package

perSystem.treefmt.programs.nixpkgs-fmt.enable

perSystem.treefmt.programs.nixpkgs-fmt.package

perSystem.treefmt.programs.ocamlformat.enable

perSystem.treefmt.programs.ocamlformat.package

perSystem.treefmt.programs.ocamlformat.configFile

perSystem.treefmt.programs.ocamlformat.pkgs

perSystem.treefmt.programs.ormolu.enable

perSystem.treefmt.programs.ormolu.package

perSystem.treefmt.programs.ormolu.ghcOpts

perSystem.treefmt.programs.php-cs-fixer.enable

perSystem.treefmt.programs.php-cs-fixer.package

perSystem.treefmt.programs.prettier.enable

perSystem.treefmt.programs.prettier.package

perSystem.treefmt.programs.prettier.excludes

perSystem.treefmt.programs.prettier.includes

perSystem.treefmt.programs.prettier.settings.arrowParens

perSystem.treefmt.programs.prettier.settings.bracketSameLine

perSystem.treefmt.programs.prettier.settings.bracketSpacing

perSystem.treefmt.programs.prettier.settings.cursorOffset

perSystem.treefmt.programs.prettier.settings.editorconfig

perSystem.treefmt.programs.prettier.settings.embeddedLanguageFormatting

perSystem.treefmt.programs.prettier.settings.endOfLine

perSystem.treefmt.programs.prettier.settings.filepath

perSystem.treefmt.programs.prettier.settings.htmlWhitespaceSensitivity

perSystem.treefmt.programs.prettier.settings.insertPragma

perSystem.treefmt.programs.prettier.settings.jsxSingleQuote

perSystem.treefmt.programs.prettier.settings.overrides

perSystem.treefmt.programs.prettier.settings.parser

perSystem.treefmt.programs.prettier.settings.pluginSearchDirs

perSystem.treefmt.programs.prettier.settings.plugins

perSystem.treefmt.programs.prettier.settings.printWidth

perSystem.treefmt.programs.prettier.settings.proseWrap

perSystem.treefmt.programs.prettier.settings.quoteProps

perSystem.treefmt.programs.prettier.settings.rangeEnd

perSystem.treefmt.programs.prettier.settings.rangeStart

perSystem.treefmt.programs.prettier.settings.requirePragma

perSystem.treefmt.programs.prettier.settings.semi

perSystem.treefmt.programs.prettier.settings.singleAttributePerLine

perSystem.treefmt.programs.prettier.settings.singleQuote

perSystem.treefmt.programs.prettier.settings.tabWidth

perSystem.treefmt.programs.prettier.settings.trailingComma

perSystem.treefmt.programs.prettier.settings.useTabs

perSystem.treefmt.programs.prettier.settings.vueIndentScriptAndStyle

perSystem.treefmt.programs.protolint.enable

perSystem.treefmt.programs.protolint.package

perSystem.treefmt.programs.purs-tidy.enable

perSystem.treefmt.programs.purs-tidy.package

perSystem.treefmt.programs.ruff.enable

perSystem.treefmt.programs.ruff.package

perSystem.treefmt.programs.ruff.format

perSystem.treefmt.programs.rufo.enable

perSystem.treefmt.programs.rufo.package

perSystem.treefmt.programs.rustfmt.enable

perSystem.treefmt.programs.rustfmt.package

perSystem.treefmt.programs.rustfmt.edition

perSystem.treefmt.programs.scalafmt.enable

perSystem.treefmt.programs.scalafmt.package

perSystem.treefmt.programs.shellcheck.enable

perSystem.treefmt.programs.shellcheck.package

perSystem.treefmt.programs.shfmt.enable

perSystem.treefmt.programs.shfmt.package

perSystem.treefmt.programs.shfmt.indent_size

perSystem.treefmt.programs.statix.enable

perSystem.treefmt.programs.statix.package

perSystem.treefmt.programs.statix.disabled-lints

perSystem.treefmt.programs.stylish-haskell.enable

perSystem.treefmt.programs.stylish-haskell.package

perSystem.treefmt.programs.stylua.enable

perSystem.treefmt.programs.stylua.package

perSystem.treefmt.programs.swift-format.enable

perSystem.treefmt.programs.swift-format.package

perSystem.treefmt.programs.taplo.enable

perSystem.treefmt.programs.taplo.package

perSystem.treefmt.programs.terraform.enable

perSystem.treefmt.programs.terraform.package

perSystem.treefmt.programs.typstfmt.enable

perSystem.treefmt.programs.typstfmt.package

perSystem.treefmt.programs.yamlfmt.enable

perSystem.treefmt.programs.yamlfmt.package

perSystem.treefmt.programs.zig.enable

perSystem.treefmt.programs.zig.package

perSystem.treefmt.programs.zprint.enable

perSystem.treefmt.programs.zprint.package

perSystem.treefmt.programs.zprint.zprintOpts

perSystem.treefmt.projectRoot

perSystem.treefmt.projectRootFile

perSystem.treefmt.settings.formatter

perSystem.treefmt.settings.formatter.<name>.command

perSystem.treefmt.settings.formatter.<name>.excludes

perSystem.treefmt.settings.formatter.<name>.includes

perSystem.treefmt.settings.formatter.<name>.options

perSystem.treefmt.settings.global.excludes

perSystem.treefmt

Project-level treefmt configuration

Use config.treefmt.build.wrapper to get access to the resulting treefmt package based on this configuration.

By default treefmt-nix will set the formatter.<system> attribute of the flake, used by the nix fmt command.

Type: submodule

Declared by:

treefmt-nix/flake-module.nix

perSystem.treefmt.package

The treefmt package to use.

Type: package

Default: pkgs.treefmt

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.build.check

Create a flake check to test that the given project tree is already formatted.

Input argument is the path to the project tree (usually ‘self’).

Type: function that evaluates to a(n) package

Default: Default check implementation

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.build.configFile

Contains the generated config file derived from the settings.

Type: path

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.build.devShell

The development shell with treefmt and its underlying programs

Type: package (read only)

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.build.programs

Attrset of formatter programs enabled in treefmt configuration.

The key of the attrset is the formatter name, with the value being the package used to do the formatting.

Type: attribute set of package

Default: Programs used in configuration

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.build.wrapper

The treefmt package, wrapped with the config file.

Type: package

Default: wrapped treefmt command

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.flakeCheck

Add a flake check to run treefmt

Type: boolean

Default: true

Declared by:

treefmt-nix/flake-module.nix

perSystem.treefmt.flakeFormatter

Enables treefmt the default formatter used by the nix fmt command

Type: boolean

Default: true

Declared by:

treefmt-nix/flake-module.nix

perSystem.treefmt.programs.alejandra.enable

Whether to enable alejandra.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/alejandra.nix

perSystem.treefmt.programs.alejandra.package

The alejandra package to use.

Type: package

Default: pkgs.alejandra

Declared by:

treefmt-nix/programs/alejandra.nix

perSystem.treefmt.programs.asmfmt.enable

Whether to enable asmfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/asmfmt.nix

perSystem.treefmt.programs.asmfmt.package

The asmfmt package to use.

Type: package

Default: pkgs.asmfmt

Declared by:

treefmt-nix/programs/asmfmt.nix

perSystem.treefmt.programs.beautysh.enable

Whether to enable beautysh.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/beautysh.nix

perSystem.treefmt.programs.beautysh.package

The beautysh package to use.

Type: package

Default: pkgs.beautysh

Declared by:

treefmt-nix/programs/beautysh.nix

perSystem.treefmt.programs.beautysh.indent_size

Sets the number of spaces to be used in indentation.

Type: signed integer

Default: 2

Example: 4

Declared by:

treefmt-nix/programs/beautysh.nix

perSystem.treefmt.programs.biome.enable

Whether to enable biome.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.package

The biome package to use.

Type: package

Default: pkgs.biome

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.excludes

Path / file patterns to exclude for Biome

Type: list of string

Default: [ ]

Example:

[
  "*.mjs"
]

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.includes

Path / file patterns to include for Biome

Type: list of string

Default:

[
  "*.js"
  "*.ts"
  "*.mjs"
  "*.mts"
  "*.cjs"
  "*.cts"
  "*.jsx"
  "*.tsx"
  "*.json"
  "*.jsonc"
]

Example:

[
  "*.mjs"
]

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.formatter.enabled

Enables Biome’s formatter

Type: boolean

Default: true

Example: false

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.formatter.formatWithErrors

Allows to format a document that has syntax errors.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.formatter.ignore

A list of Unix shell style patterns. Biome ignores files and folders that match these patterns.

Type: list of string

Default: [ ]

Example:

[
  "scripts/*.js"
]

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.formatter.include

A list of Unix shell style patterns. Biome handles only the files and folders that match these patterns.

[!Caution] When both include and ignore are specified, ignore takes precedence over include

Type: list of string

Default: [ ]

Example:

[
  "scripts/*.js"
]

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.formatter.indentStyle

The style of the indentation. It can be tab or space.

Type: one of “tab”, “space”

Default: "tab"

Example: "space"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.formatter.indentWidth

How big the indentation should be.

Type: signed integer

Default: 2

Example: 4

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.formatter.lineEnding

The type of line ending.

Type: one of “lf”, “crlf”, “cr”

Default: "lf"

Example: "cr"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.formatter.lineWidth

How many characters can be written on a single line.

Type: signed integer

Default: 80

Example: 90

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.enabled

Enables Biome’s formatter for JavaScript (and its super languages) files.

Type: boolean

Default: true

Example: false

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.arrowParentheses

Whether to add non-necessary parentheses to arrow functions:

  • always, the parentheses are always added;

  • asNeeded, the parentheses are added only when they are needed;

Type: one of “always”, “asNeeded”

Default: "always"

Example: "asNeeded"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.bracketSameLine

Choose whether the ending > of a multi-line JSX element should be on the last attribute line or not

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.bracketSpacing

Choose whether spaces should be added between brackets and inner values

Type: boolean

Default: true

Example: false

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.indentStyle

The style of the indentation. It can be tab or space.

Type: one of “tab”, “space”

Default: "tab"

Example: "space"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.indentWidth

How big the indentation should be.

Type: signed integer

Default: 2

Example: 4

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.jsxQuoteStyle

The type of quote used when representing jsx string literals. It can be single or double.

Type: one of “single”, “double”

Default: "double"

Example: "single"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.lineEnding

The type of line ending.

Type: one of “lf”, “crlf”, “cr”

Default: "lf"

Example: "cr"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.lineWidth

How many characters can be written on a single line.

Type: signed integer

Default: 80

Example: 90

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.quoteProperties

When properties inside objects should be quoted. It can be asNeeded or preserve.

Type: one of “asNeeded”, “preserve”

Default: "asNeeded"

Example: "preserve"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.quoteStyle

The type of quote used when representing string literals. It can be single or double.

Type: one of “single”, “double”

Default: "double"

Example: "single"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.semicolons

It configures where the formatter prints semicolons:

  • always, the semicolons is always added at the end of each statement;

  • asNeeded, the semicolons are added only in places where it’s needed, to protect from ASI

Type: one of “always”, “asNeeded”

Default: "always"

Example: "asNeeded"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.formatter.trailingComma

Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Possible values:

  • all, the trailing comma is always added

  • es5, the trailing comma is added only in places where it’s supported by older version of JavaScript

  • none, trailing commas are never added

Type: one of “all”, “es5”, “none”

Default: "all"

Example: "none"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.globals

A list of global names that Biome should ignore

Type: list of string

Default: [ ]

Example:

[
  "$"
  "_"
  "externalVariable"
]

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.javascript.parser.unsafeParameterDecoratorsEnabled

Allows to support the unsafe/experimental parameter decorators.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.json.formatter.enabled

Enables Biome’s formatter for JSON (and its super languages) files.

Type: boolean

Default: true

Example: false

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.json.formatter.indentStyle

The style of the indentation. It can be tab or space.

Type: one of “tab”, “space”

Default: "tab"

Example: "space"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.json.formatter.indentWidth

How big the indentation should be.

Type: signed integer

Default: 2

Example: 4

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.json.formatter.lineEnding

The type of line ending.

Type: one of “lf”, “crlf”, “cr”

Default: "lf"

Example: "cr"

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.json.formatter.lineWidth

How many characters can be written on a single line.

Type: signed integer

Default: 80

Example: 90

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.json.parser.allowComments

Enables the parsing of comments in JSON files.

Type: boolean

Default: true

Example: false

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.json.parser.allowTrailingCommas

Enables the parsing of trailing Commas in JSON files.

Type: boolean

Default: true

Example: false

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.organizeImports.enabled

Enables Biome’s sort imports.

Type: boolean

Default: true

Example: false

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.organizeImports.ignore

A list of Unix shell style patterns. Biome ignores files and folders that match these patterns.

Type: list of string

Default: [ ]

Example:

[
  "scripts/*.js"
]

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.biome.settings.organizeImports.include

A list of Unix shell style patterns. Biome handles only the files and folders that match these patterns.

[!Caution] When both include and ignore are specified, ignore takes precedence over include

Type: list of string

Default: [ ]

Example:

[
  "scripts/*.js"
]

Declared by:

treefmt-nix/programs/biome.nix

perSystem.treefmt.programs.black.enable

Whether to enable black.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/black.nix

perSystem.treefmt.programs.black.package

The black package to use.

Type: package

Default: pkgs.black

Declared by:

treefmt-nix/programs/black.nix

perSystem.treefmt.programs.buildifier.enable

Whether to enable buildifier.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/buildifier.nix

perSystem.treefmt.programs.buildifier.package

The buildifier package to use.

Type: package

Default: pkgs.buildifier

Declared by:

treefmt-nix/programs/buildifier.nix

perSystem.treefmt.programs.buildifier.includes

Bazel file patterns to format

Type: list of string

Default:

[
  "BUILD.bazel"
  "*.bzl"
]

Declared by:

treefmt-nix/programs/buildifier.nix

perSystem.treefmt.programs.cabal-fmt.enable

Whether to enable cabal-fmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/cabal-fmt.nix

perSystem.treefmt.programs.cabal-fmt.package

cabal-fmt derivation to use.

Type: package

Default: pkgs.haskellPackages.cabal-fmt

Declared by:

treefmt-nix/programs/cabal-fmt.nix

perSystem.treefmt.programs.clang-format.enable

Whether to enable clang-format.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/clang-format.nix

perSystem.treefmt.programs.clang-format.package

The clang-tools package to use.

Type: package

Default: pkgs.clang-tools

Declared by:

treefmt-nix/programs/clang-format.nix

perSystem.treefmt.programs.cljfmt.enable

Whether to enable cljfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/cljfmt.nix

perSystem.treefmt.programs.cljfmt.package

The cljfmt package to use.

Type: package

Default: pkgs.cljfmt

Declared by:

treefmt-nix/programs/cljfmt.nix

perSystem.treefmt.programs.cljfmt.includes

Clojure file patterns to format

Type: list of string

Default:

[
  "*.clj"
  "*.cljc"
  "*.cljs"
  "*.cljx"
]

Declared by:

treefmt-nix/programs/cljfmt.nix

perSystem.treefmt.programs.csharpier.enable

Whether to enable csharpier.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/csharpier.nix

perSystem.treefmt.programs.csharpier.package

The csharpier package to use.

Type: package

Default: pkgs.csharpier

Declared by:

treefmt-nix/programs/csharpier.nix

perSystem.treefmt.programs.csharpier.dotnet-sdk

The dotnet-sdk package to use.

Type: package

Default: pkgs.dotnet-sdk

Declared by:

treefmt-nix/programs/csharpier.nix

perSystem.treefmt.programs.cue.enable

Whether to enable cue.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/cue.nix

perSystem.treefmt.programs.cue.package

The cue package to use.

Type: package

Default: pkgs.cue

Declared by:

treefmt-nix/programs/cue.nix

perSystem.treefmt.programs.deadnix.enable

Whether to enable deadnix.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/deadnix.nix

perSystem.treefmt.programs.deadnix.package

The deadnix package to use.

Type: package

Default: pkgs.deadnix

Declared by:

treefmt-nix/programs/deadnix.nix

perSystem.treefmt.programs.deadnix.no-lambda-arg

Whether to enable Don’t check lambda parameter arguments.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/deadnix.nix

perSystem.treefmt.programs.deadnix.no-lambda-pattern-names

Whether to enable Don’t check lambda attrset pattern names (don’t break nixpkgs callPackage).

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/deadnix.nix

perSystem.treefmt.programs.deadnix.no-underscore

Whether to enable Don’t check any bindings that start with a _.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/deadnix.nix

perSystem.treefmt.programs.deno.enable

Whether to enable deno.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/deno.nix

perSystem.treefmt.programs.deno.package

deno derivation to use.

Type: package

Default: pkgs.deno

Declared by:

treefmt-nix/programs/deno.nix

perSystem.treefmt.programs.deno.excludes

Path / file patterns to exclude for Deno

Type: list of string

Default: [ ]

Declared by:

treefmt-nix/programs/deno.nix

perSystem.treefmt.programs.deno.includes

Path / file patterns to include for Deno

Type: list of string

Default:

[
  "*.js"
  "*.json"
  "*.jsonc"
  "*.jsx"
  "*.markdown"
  "*.md"
  "*.ts"
  "*.tsx"
]

Declared by:

treefmt-nix/programs/deno.nix

perSystem.treefmt.programs.dhall.enable

Whether to enable Dhall.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/dhall.nix

perSystem.treefmt.programs.dhall.package

The Dhall package to use.

Type: package

Default: pkgs.dhall

Declared by:

treefmt-nix/programs/dhall.nix

perSystem.treefmt.programs.dhall.lint

Whether to lint in addition to formatting.

Type: boolean

Default: false

Declared by:

treefmt-nix/programs/dhall.nix

perSystem.treefmt.programs.dprint.enable

Whether to enable dprint.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.dprint.package

The dprint package to use.

Type: package

Default: pkgs.dprint

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.dprint.settings.excludes

Array of patterns (globs) to exclude files or directories to format.

Type: null or (list of string)

Default: null

Example:

[
  "**/node_modules"
  "**/*-lock.json"
]

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.dprint.settings.extends

Configurations to extend.

Type: null or string or list of string

Default: null

Example: "https://dprint.dev/path/to/config/file.v1.json"

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.dprint.settings.includes

Array of patterns (globs) to use to find files to format.

Type: null or (list of string)

Default: null

Example:

[
  "**/*.{ts,tsx,js,jsx,mjs,json,md}"
]

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.dprint.settings.incremental

Whether to format files only when they change.

Type: null or boolean

Default: null

Example: true

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.dprint.settings.indentWidth

The number of characters for an indent

Type: null or signed integer

Default: null

Example: 2

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.dprint.settings.lineWidth

The width of a line the printer will try to stay under. Note that the printer may exceed this width in certain cases.

Type: null or signed integer

Default: null

Example: 80

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.dprint.settings.newLineKind

The kind of newline to use (one of: auto, crlf, lf, system).

Type: null or string

Default: null

Example: "auto"

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.dprint.settings.plugins

Array of plugin URLs to format files.

Type: null or (list of string)

Default: null

Example:

[
  "https://plugins.dprint.dev/json-0.17.2.wasm"
  "https://plugins.dprint.dev/markdown-0.15.2.wasm"
  "https://plugins.dprint.dev/typescript-0.84.4.wasm"
]

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.dprint.settings.useTabs

Whether to use tabs (true) or spaces (false) for indentation.

Type: null or boolean

Default: null

Example: true

Declared by:

treefmt-nix/programs/dprint.nix

perSystem.treefmt.programs.elm-format.enable

Whether to enable elm-format.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/elm-format.nix

perSystem.treefmt.programs.elm-format.package

elm-format derivation to use.

Type: package

Default: pkgs.elmPackages.elm-format

Declared by:

treefmt-nix/programs/elm-format.nix

perSystem.treefmt.programs.erlfmt.enable

Whether to enable erlfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/erlfmt.nix

perSystem.treefmt.programs.erlfmt.package

The erlfmt package to use.

Type: package

Default: pkgs.erlfmt

Declared by:

treefmt-nix/programs/erlfmt.nix

perSystem.treefmt.programs.erlfmt.print-width

The line length that formatter would wrap on

Type: signed integer

Default: 100

Example: 80

Declared by:

treefmt-nix/programs/erlfmt.nix

perSystem.treefmt.programs.fnlfmt.enable

Whether to enable fnlfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/fnlfmt.nix

perSystem.treefmt.programs.fnlfmt.package

The fnlfmt package to use.

Type: package

Default: pkgs.fnlfmt

Declared by:

treefmt-nix/programs/fnlfmt.nix

perSystem.treefmt.programs.formatjson5.enable

Whether to enable formatjson5.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/formatjson5.nix

perSystem.treefmt.programs.formatjson5.package

The formatjson5 package to use.

Type: package

Default: pkgs.formatjson5

Declared by:

treefmt-nix/programs/formatjson5.nix

perSystem.treefmt.programs.formatjson5.indent

Indent by the given number of spaces

Type: signed integer

Default: 4

Declared by:

treefmt-nix/programs/formatjson5.nix

perSystem.treefmt.programs.formatjson5.noTrailingCommas

Suppress trailing commas (otherwise added by default)

Type: boolean

Default: false

Declared by:

treefmt-nix/programs/formatjson5.nix

perSystem.treefmt.programs.formatjson5.oneElementLines

Objects or arrays with a single child should collapse to a single line

Type: boolean

Default: false

Declared by:

treefmt-nix/programs/formatjson5.nix

perSystem.treefmt.programs.formatjson5.sortArrays

Sort arrays of primitive values (string, number, boolean, or null) lexicographically

Type: boolean

Default: false

Declared by:

treefmt-nix/programs/formatjson5.nix

perSystem.treefmt.programs.fourmolu.enable

Whether to enable fourmolu.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/fourmolu.nix

perSystem.treefmt.programs.fourmolu.package

fourmolu derivation to use.

Type: package

Default: pkgs.haskellPackages.fourmolu

Declared by:

treefmt-nix/programs/fourmolu.nix

perSystem.treefmt.programs.fourmolu.ghcOpts

Which GHC language extensions to enable

Type: unspecified value

Default:

[
  "BangPatterns"
  "PatternSynonyms"
  "TypeApplications"
]

Declared by:

treefmt-nix/programs/fourmolu.nix

perSystem.treefmt.programs.fprettify.enable

Whether to enable fprettify.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/fprettify.nix

perSystem.treefmt.programs.fprettify.package

The fprettify package to use.

Type: package

Default: pkgs.fprettify

Declared by:

treefmt-nix/programs/fprettify.nix

perSystem.treefmt.programs.gofmt.enable

Whether to enable gofmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/gofmt.nix

perSystem.treefmt.programs.gofmt.package

The go package to use.

Type: package

Default: pkgs.go

Declared by:

treefmt-nix/programs/gofmt.nix

perSystem.treefmt.programs.gofumpt.enable

Whether to enable gofumpt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/gofumpt.nix

perSystem.treefmt.programs.gofumpt.package

The gofumpt package to use.

Type: package

Default: pkgs.gofumpt

Declared by:

treefmt-nix/programs/gofumpt.nix

perSystem.treefmt.programs.gofumpt.extra

Whether to enable extra rules.

Type: boolean

Default: false

Declared by:

treefmt-nix/programs/gofumpt.nix

perSystem.treefmt.programs.google-java-format.enable

Whether to enable google-java-format.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/google-java-format.nix

perSystem.treefmt.programs.google-java-format.package

The google-java-format package to use.

Type: package

Default: pkgs.google-java-format

Declared by:

treefmt-nix/programs/google-java-format.nix

perSystem.treefmt.programs.hclfmt.enable

Whether to enable hclfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/hclfmt.nix

perSystem.treefmt.programs.hclfmt.package

The hclfmt package to use.

Type: package

Default: pkgs.hclfmt

Declared by:

treefmt-nix/programs/hclfmt.nix

perSystem.treefmt.programs.hlint.enable

Whether to enable hlint.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/hlint.nix

perSystem.treefmt.programs.hlint.package

The hlint package to use.

Type: package

Default: pkgs.hlint

Declared by:

treefmt-nix/programs/hlint.nix

perSystem.treefmt.programs.isort.enable

Whether to enable isort.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/isort.nix

perSystem.treefmt.programs.isort.package

The isort package to use.

Type: package

Default: pkgs.isort

Declared by:

treefmt-nix/programs/isort.nix

perSystem.treefmt.programs.isort.profile

The profile to use for isort.

Type: string

Default: ""

Declared by:

treefmt-nix/programs/isort.nix

perSystem.treefmt.programs.jsonfmt.enable

Whether to enable jsonfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/jsonfmt.nix

perSystem.treefmt.programs.jsonfmt.package

The jsonfmt package to use.

Type: package

Default: pkgs.jsonfmt

Declared by:

treefmt-nix/programs/jsonfmt.nix

perSystem.treefmt.programs.jsonnet-lint.enable

Whether to enable jsonnet.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/jsonnet-lint.nix

perSystem.treefmt.programs.jsonnet-lint.package

The go-jsonnet package to use.

Type: package

Default: pkgs.go-jsonnet

Declared by:

treefmt-nix/programs/jsonnet-lint.nix

perSystem.treefmt.programs.jsonnetfmt.enable

Whether to enable jsonnet.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/jsonnetfmt.nix

perSystem.treefmt.programs.jsonnetfmt.package

The go-jsonnet package to use.

Type: package

Default: pkgs.go-jsonnet

Declared by:

treefmt-nix/programs/jsonnetfmt.nix

perSystem.treefmt.programs.just.enable

Whether to enable just.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/just.nix

perSystem.treefmt.programs.just.package

The just package to use.

Type: package

Default: pkgs.just

Declared by:

treefmt-nix/programs/just.nix

perSystem.treefmt.programs.keep-sorted.enable

Whether to enable keep-sorted.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/keep-sorted.nix

perSystem.treefmt.programs.keep-sorted.package

The keep-sorted package to use.

Type: package

Default: pkgs.keep-sorted

Declared by:

treefmt-nix/programs/keep-sorted.nix

perSystem.treefmt.programs.ktfmt.enable

Whether to enable ktfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/ktfmt.nix

perSystem.treefmt.programs.ktfmt.package

The ktfmt package to use.

Type: package

Default: pkgs.ktfmt

Declared by:

treefmt-nix/programs/ktfmt.nix

perSystem.treefmt.programs.ktlint.enable

Whether to enable ktlint.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/ktlint.nix

perSystem.treefmt.programs.ktlint.package

The ktlint package to use.

Type: package

Default: pkgs.ktlint

Declared by:

treefmt-nix/programs/ktlint.nix

perSystem.treefmt.programs.leptosfmt.enable

Whether to enable leptosfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/leptosfmt.nix

perSystem.treefmt.programs.leptosfmt.package

The leptosfmt package to use.

Type: package

Default: pkgs.leptosfmt

Declared by:

treefmt-nix/programs/leptosfmt.nix

perSystem.treefmt.programs.mdformat.enable

Whether to enable mdformat.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/mdformat.nix

perSystem.treefmt.programs.mdformat.package

The mdformat package to use.

Type: package

Default: pkgs.python3Packages.mdformat

Declared by:

treefmt-nix/programs/mdformat.nix

perSystem.treefmt.programs.mdsh.enable

Whether to enable mdsh.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/mdsh.nix

perSystem.treefmt.programs.mdsh.package

The mdsh package to use.

Type: package

Default: pkgs.mdsh

Declared by:

treefmt-nix/programs/mdsh.nix

perSystem.treefmt.programs.mix-format.enable

Whether to enable mix-format.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/mix-format.nix

perSystem.treefmt.programs.mix-format.package

The elixir package to use.

Type: package

Default: pkgs.elixir

Declared by:

treefmt-nix/programs/mix-format.nix

perSystem.treefmt.programs.muon.enable

Whether to enable muon.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/muon.nix

perSystem.treefmt.programs.muon.package

The muon package to use.

Type: package

Default: pkgs.muon

Declared by:

treefmt-nix/programs/muon.nix

perSystem.treefmt.programs.mypy.enable

Whether to enable mypy.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/mypy.nix

perSystem.treefmt.programs.mypy.directories

Directories to run mypy in

Type: attribute set of (submodule)

Default:

{
  "." = { };
}

Example:

{
  "." = {
    modules = [
      "mymodule"
      "tests"
    ];
  };
  "./subdir" = {
    modules = [
      "."
    ];
  };
}

Declared by:

treefmt-nix/programs/mypy.nix

perSystem.treefmt.programs.mypy.directories.<name>.directory

Directory to run mypy in

Type: string

Default: "‹name›"

Declared by:

treefmt-nix/programs/mypy.nix

perSystem.treefmt.programs.mypy.directories.<name>.extraPythonPackages

Extra packages to add to PYTHONPATH

Type: list of package

Default: [ ]

Example: [ pkgs.python3.pkgs.requests ]

Declared by:

treefmt-nix/programs/mypy.nix

perSystem.treefmt.programs.mypy.directories.<name>.files

Single files to check. Can be globs

Type: list of string

Default: [ ]

Example:

[
  "./**/tasks.py"
]

Declared by:

treefmt-nix/programs/mypy.nix

perSystem.treefmt.programs.mypy.directories.<name>.modules

Modules to check

Type: list of string

Default:

[
  "."
]

Example:

[
  "mymodule"
  "tests"
]

Declared by:

treefmt-nix/programs/mypy.nix

perSystem.treefmt.programs.mypy.directories.<name>.options

Options to pass to mypy

Type: list of string

Default: [ ]

Example:

[
  "--ignore-missing-imports"
]

Declared by:

treefmt-nix/programs/mypy.nix

perSystem.treefmt.programs.nickel.enable

Whether to enable nickel.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/nickel.nix

perSystem.treefmt.programs.nickel.package

The nickel package to use.

Type: package

Default: pkgs.nickel

Declared by:

treefmt-nix/programs/nickel.nix

perSystem.treefmt.programs.nixfmt.enable

Whether to enable nixfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/nixfmt.nix

perSystem.treefmt.programs.nixfmt.package

The nixfmt package to use.

Type: package

Default: pkgs.nixfmt

Declared by:

treefmt-nix/programs/nixfmt.nix

perSystem.treefmt.programs.nixpkgs-fmt.enable

Whether to enable nixpkgs-fmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/nixpkgs-fmt.nix

perSystem.treefmt.programs.nixpkgs-fmt.package

The nixpkgs-fmt package to use.

Type: package

Default: pkgs.nixpkgs-fmt

Declared by:

treefmt-nix/programs/nixpkgs-fmt.nix

perSystem.treefmt.programs.ocamlformat.enable

Whether to enable ocamlformat.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/ocamlformat.nix

perSystem.treefmt.programs.ocamlformat.package

The ocamlformat package to use.

Type: package

Default: pkgs.ocamlformat

Declared by:

treefmt-nix/programs/ocamlformat.nix

perSystem.treefmt.programs.ocamlformat.configFile

Path to the .ocamlformat file. Used to pick the right version of ocamlformat if passed.

Type: null or path

Default: null

Declared by:

treefmt-nix/programs/ocamlformat.nix

perSystem.treefmt.programs.ocamlformat.pkgs

The package set used to get the ocamlformat package at a specific version.

Type: lazy attribute set of raw value

Default: Nixpkgs from context

Declared by:

treefmt-nix/programs/ocamlformat.nix

perSystem.treefmt.programs.ormolu.enable

Whether to enable ormolu.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/ormolu.nix

perSystem.treefmt.programs.ormolu.package

The ormolu package to use.

Type: package

Default: pkgs.ormolu

Declared by:

treefmt-nix/programs/ormolu.nix

perSystem.treefmt.programs.ormolu.ghcOpts

Which GHC language extensions to enable

Type: unspecified value

Default:

[
  "BangPatterns"
  "PatternSynonyms"
  "TypeApplications"
]

Declared by:

treefmt-nix/programs/ormolu.nix

perSystem.treefmt.programs.php-cs-fixer.enable

Whether to enable php-cs-fixer.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/php-cs-fixer.nix

perSystem.treefmt.programs.php-cs-fixer.package

The php-cs-fixer package to use.

Type: package

Default: pkgs.php-cs-fixer

Declared by:

treefmt-nix/programs/php-cs-fixer.nix

perSystem.treefmt.programs.prettier.enable

Whether to enable prettier.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.package

prettier derivation to use.

Type: package

Default: pkgs.nodePackages.prettier

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.excludes

Path / file patterns to exclude for Prettier

Type: list of string

Default: [ ]

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.includes

Path / file patterns to include for Prettier

Type: list of string

Default:

[
  "*.cjs"
  "*.css"
  "*.html"
  "*.js"
  "*.json"
  "*.json5"
  "*.jsx"
  "*.md"
  "*.mdx"
  "*.mjs"
  "*.scss"
  "*.ts"
  "*.tsx"
  "*.vue"
  "*.yaml"
  "*.yml"
]

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.arrowParens

Include parentheses around a sole arrow function parameter.

Type: null or one of “always”, “avoid”

Default: null

Example: "always"

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.bracketSameLine

Put > of opening tags on the last line instead of on a new line.

Type: null or boolean

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.bracketSpacing

Print spaces between brackets

Type: null or boolean

Default: null

Example: true

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.cursorOffset

Print (to stderr) where a cursor at the given position would move to after formatting. This option cannot be used with --range-start and –range-end.

Type: null or signed integer

Default: null

Example: -1

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.editorconfig

Whether parse the .editorconfig file in your project and convert its properties to the corresponding Prettier configuration. This configuration will be overridden by .prettierrc, etc.

Type: null or boolean

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.embeddedLanguageFormatting

Control how Prettier formats quoted code embedded in the file.

Type: null or one of “auto”, “off”

Default: null

Example: "auto"

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.endOfLine

Which end of line characters to apply.

Type: null or one of “lf”, “crlf”, “cr”, “auto”

Default: null

Example: "lf"

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.filepath

Specify the input filepath. This will be used to do parser inference.

Type: null or string

Default: null

Example: "example.js"

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.htmlWhitespaceSensitivity

How to handle whitespaces in HTML.

Type: null or one of “css”, “strict”, “ignore”

Default: null

Example: "css"

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.insertPragma

Insert @format pragma into file’s first docblock commentypes.

Type: null or boolean

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.jsxSingleQuote

Use single quotes in JSX

Type: null or boolean

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.overrides

Provide a list of patterns to override prettier configuration.

Type: null or (list of (attribute set))

Default: null

Example:

{
  files = [
    "*.html"
    "legacy/**/*.js"
  ];
  options = {
    tabwidth = 4;
  };
}

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.parser

Which parser to use.

Type: null or one of “flow”, “babel”, “babel-flow”, “babel-ts”, “typescript”, “acorn”, “espree”, “meriyah”, “css”, “less”, “scss”, “json”, “json5”, “json-stringify”, “graphql”, “markdown”, “mdx”, “vue”, “yaml”, “glimmer”, “html”, “angular”, “lwc” or string

Default: null

Example: "typescript"

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.pluginSearchDirs

Custom directory that contains prettier plugins in node_modules subdirectory. Overrides default behavior when plugins are searched relatively to the location of Prettier.\nMultiple values are accepted.

Type: null or (list of string) or value false (singular enum)

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.plugins

Add a plugin. Multiple plugins can be passed as separate --plugins.

Type: null or (list of string)

Default: null

Example:

[
  "@prettier/plugin-xml"
]

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.printWidth

The line length where Prettier will try wrap.

Type: null or signed integer

Default: null

Example: 80

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.proseWrap

How to wrap prose.

Type: null or one of “always”, “never”, “preserve”

Default: null

Example: "preserve"

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.quoteProps

Change when properties in objects are quoted

Type: null or one of “as-needed”, “consistent”, “preserve”

Default: null

Example: "as-needed"

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.rangeEnd

Format code ending at a given character offset (exclusive). The range will extend forwards to the end of the selected statementypes. This option cannot be used with --cursor-offsetypes.

Type: null or string

Default: null

Example: 0

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.rangeStart

Format code starting at a given character offsetypes. The range will extend backwards to the start of the first line containing the selected statementypes. his option cannot be used with --cursor-offsetypes.

Type: null or signed integer

Default: null

Example: 0

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.requirePragma

Require either ‘@prettier’ or ‘@format’ to be present in the file’s first docblock comment\nin order for it to be formatted.

Type: null or boolean

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.semi

Print semicolons.

Type: null or boolean

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.singleAttributePerLine

Enforce single attribute per line in HTML, Vue and JSX.

Type: null or boolean

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.singleQuote

Use single quotes instead of double quotes.

Type: null or boolean

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.tabWidth

Number of spaces per indentation level.

Type: null or signed integer

Default: null

Example: 2

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.trailingComma

Print trailing commas wherever possible when multi-line.

Type: null or one of “es5”, “none”, “all”

Default: null

Example: "es5"

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.useTabs

Indent with tabs instead of spaces

Type: null or boolean

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.prettier.settings.vueIndentScriptAndStyle

Indent script and style tags in Vue files.

Type: null or boolean

Default: null

Example: false

Declared by:

treefmt-nix/programs/prettier.nix

perSystem.treefmt.programs.protolint.enable

Whether to enable protolint.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/protolint.nix

perSystem.treefmt.programs.protolint.package

The protolint package to use.

Type: package

Default: pkgs.protolint

Declared by:

treefmt-nix/programs/protolint.nix

perSystem.treefmt.programs.purs-tidy.enable

Whether to enable purs-tidy.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/purs-tidy.nix

perSystem.treefmt.programs.purs-tidy.package

purs-tidy derivation to use.

Type: package

Default: pkgs.nodePackages.purs-tidy

Declared by:

treefmt-nix/programs/purs-tidy.nix

perSystem.treefmt.programs.ruff.enable

Whether to enable ruff.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/ruff.nix

perSystem.treefmt.programs.ruff.package

The ruff package to use.

Type: package

Default: pkgs.ruff

Declared by:

treefmt-nix/programs/ruff.nix

perSystem.treefmt.programs.ruff.format

Whether to enable the Ruff formatter, an extremely fast Python code formatter designed as a drop-in replacement for Black.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/ruff.nix

perSystem.treefmt.programs.rufo.enable

Whether to enable rufo.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/rufo.nix

perSystem.treefmt.programs.rufo.package

The rufo package to use.

Type: package

Default: pkgs.rufo

Declared by:

treefmt-nix/programs/rufo.nix

perSystem.treefmt.programs.rustfmt.enable

Whether to enable rustfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/rustfmt.nix

perSystem.treefmt.programs.rustfmt.package

The rustfmt package to use.

Type: package

Default: pkgs.rustfmt

Declared by:

treefmt-nix/programs/rustfmt.nix

perSystem.treefmt.programs.rustfmt.edition

Rust edition to target when formatting

Type: string

Default: "2021"

Declared by:

treefmt-nix/programs/rustfmt.nix

perSystem.treefmt.programs.scalafmt.enable

Whether to enable scalafmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/scalafmt.nix

perSystem.treefmt.programs.scalafmt.package

The scalafmt package to use.

Type: package

Default: pkgs.scalafmt

Declared by:

treefmt-nix/programs/scalafmt.nix

perSystem.treefmt.programs.shellcheck.enable

Whether to enable shellcheck.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/shellcheck.nix

perSystem.treefmt.programs.shellcheck.package

The shellcheck package to use.

Type: package

Default: pkgs.shellcheck

Declared by:

treefmt-nix/programs/shellcheck.nix

perSystem.treefmt.programs.shfmt.enable

Whether to enable shfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/shfmt.nix

perSystem.treefmt.programs.shfmt.package

The shfmt package to use.

Type: package

Default: pkgs.shfmt

Declared by:

treefmt-nix/programs/shfmt.nix

perSystem.treefmt.programs.shfmt.indent_size

Sets the number of spaces to be used in indentation. Uses tabs if set to zero. If this is null, then .editorconfig will be used to configure shfmt.

Type: null or signed integer

Default: 2

Example: 4

Declared by:

treefmt-nix/programs/shfmt.nix

perSystem.treefmt.programs.statix.enable

Whether to enable statix.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/statix.nix

perSystem.treefmt.programs.statix.package

The statix package to use.

Type: package

Default: pkgs.statix

Declared by:

treefmt-nix/programs/statix.nix

perSystem.treefmt.programs.statix.disabled-lints

List of ignored lints. Run statix list to see all available lints.

Type: list of string

Default: [ ]

Example:

[
  "empty_pattern"
]

Declared by:

treefmt-nix/programs/statix.nix

perSystem.treefmt.programs.stylish-haskell.enable

Whether to enable stylish-haskell.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/stylish-haskell.nix

perSystem.treefmt.programs.stylish-haskell.package

The stylish-haskell package to use.

Type: package

Default: pkgs.stylish-haskell

Declared by:

treefmt-nix/programs/stylish-haskell.nix

perSystem.treefmt.programs.stylua.enable

Whether to enable stylua.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/stylua.nix

perSystem.treefmt.programs.stylua.package

The stylua package to use.

Type: package

Default: pkgs.stylua

Declared by:

treefmt-nix/programs/stylua.nix

perSystem.treefmt.programs.swift-format.enable

Whether to enable swift-format.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/swift-format.nix

perSystem.treefmt.programs.swift-format.package

The swift-format package to use.

Type: package

Default: pkgs.swift-format

Declared by:

treefmt-nix/programs/swift-format.nix

perSystem.treefmt.programs.taplo.enable

Whether to enable taplo.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/taplo.nix

perSystem.treefmt.programs.taplo.package

The taplo package to use.

Type: package

Default: pkgs.taplo

Declared by:

treefmt-nix/programs/taplo.nix

perSystem.treefmt.programs.terraform.enable

Whether to enable terraform.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/terraform.nix

perSystem.treefmt.programs.terraform.package

The terraform package to use.

Type: package

Default: pkgs.terraform

Declared by:

treefmt-nix/programs/terraform.nix

perSystem.treefmt.programs.typstfmt.enable

Whether to enable typstfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/typstfmt.nix

perSystem.treefmt.programs.typstfmt.package

The typstfmt package to use.

Type: package

Default: pkgs.typstfmt

Declared by:

treefmt-nix/programs/typstfmt.nix

perSystem.treefmt.programs.yamlfmt.enable

Whether to enable yamlfmt.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/yamlfmt.nix

perSystem.treefmt.programs.yamlfmt.package

The yamlfmt package to use.

Type: package

Default: pkgs.yamlfmt

Declared by:

treefmt-nix/programs/yamlfmt.nix

perSystem.treefmt.programs.zig.enable

Whether to enable zig.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/zig.nix

perSystem.treefmt.programs.zig.package

The zig package to use.

Type: package

Default: pkgs.zig

Declared by:

treefmt-nix/programs/zig.nix

perSystem.treefmt.programs.zprint.enable

Whether to enable zprint.

Type: boolean

Default: false

Example: true

Declared by:

treefmt-nix/programs/zprint.nix

perSystem.treefmt.programs.zprint.package

zprint derivation to use.

Type: package

Default: pkgs.zprint

Declared by:

treefmt-nix/programs/zprint.nix

perSystem.treefmt.programs.zprint.zprintOpts

Clojure map containing zprint options.

Type: null or string

Default: null

Example: "{:width 90}"

Declared by:

treefmt-nix/programs/zprint.nix

perSystem.treefmt.projectRoot

Path to the root of the project on which treefmt operates

Type: path

Default: self

Declared by:

treefmt-nix/flake-module.nix

perSystem.treefmt.projectRootFile

File to look for to determine the root of the project in the build.wrapper.

Type: unspecified value

Example: "flake.nix"

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.settings.formatter

Set of formatters to use

Type: attribute set of (submodule)

Default: { }

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.settings.formatter.<name>.command

Executable obeying the treefmt formatter spec

Type: Path to executable

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.settings.formatter.<name>.excludes

List of files to exclude for formatting. Supports globbing. Takes precedence over the includes.

Type: list of string

Default: [ ]

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.settings.formatter.<name>.includes

List of files to include for formatting. Supports globbing.

Type: list of string

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.settings.formatter.<name>.options

List of arguments to pass to the command

Type: list of string

Default: [ ]

Declared by:

treefmt-nix/module-options.nix

perSystem.treefmt.settings.global.excludes

A global list of paths to exclude. Supports glob.

Type: list of string

Default: [ ]

Example:

[
  "./node_modules/**"
]

Declared by:

treefmt-nix/module-options.nix