Core Options

flake

Raw flake attributes. Any attribute can be set here, but some attributes are represented by options, to provide appropriate configuration merging.

Type: lazy attribute set of raw value

Declared by:

flake-parts/modules/packages.nix, flake-parts/modules/overlays.nix, flake-parts/modules/nixosModules.nix, flake-parts/modules/nixosConfigurations.nix, flake-parts/modules/legacyPackages.nix, flake-parts/modules/formatter.nix, flake-parts/modules/flake.nix, flake-parts/modules/devShells.nix, flake-parts/modules/darwinModules.nix, flake-parts/modules/checks.nix, flake-parts/modules/apps.nix

flake.packages

Per system an attribute set of packages. nix build .#<name> will build packages.<system>.<name>.

Type: lazy attribute set of lazy attribute set of package

Default: { }

Declared by:

flake-parts/modules/packages.nix

flake.apps

Programs runnable with nix run .#<name>.

Type: lazy attribute set of lazy attribute set of submodule

Default: { }

Example:

{
  x86_64-linux.default.program = "${config.packages.hello}/bin/hello";
}

Declared by:

flake-parts/modules/apps.nix

flake.apps.<name>.<name>.program

A path to an executable or a derivation with meta.mainProgram.

Type: string or package convertible to it

Declared by:

flake-parts/modules/apps.nix

flake.apps.<name>.<name>.type

A type tag for apps consumers.

Type: value "app" (singular enum)

Default: "app"

Declared by:

flake-parts/modules/apps.nix

flake.checks

Derivations to be built by nix flake check.

Type: lazy attribute set of lazy attribute set of package

Default: { }

Declared by:

flake-parts/modules/checks.nix

flake.darwinModules

Nix-darwin modules.

Type: lazy attribute set of unspecified

Default: { }

Declared by:

flake-parts/modules/darwinModules.nix

flake.devShells

Per system an attribute set of packages used as shells. nix develop .#<name> will run devShells.<system>.<name>.

Type: lazy attribute set of lazy attribute set of package

Default: { }

Declared by:

flake-parts/modules/devShells.nix

flake.formatter

Per system package used by nix fmt.

Type: lazy attribute set of package

Default: { }

Declared by:

flake-parts/modules/formatter.nix

flake.legacyPackages

Per system, an attribute set of unmergeable values. This is also used by nix build .#<attrpath>.

Type: lazy attribute set of lazy attribute set of raw value

Default: { }

Declared by:

flake-parts/modules/legacyPackages.nix

flake.nixosConfigurations

Instantiated NixOS configurations.

Type: lazy attribute set of raw value

Default: { }

Example:

{
  my-machine = inputs.nixpkgs.lib.nixosSystem {
    system = "x86_64-linux";
    modules = [
      ./my-machine/nixos-configuration.nix
    ];
  };
}

Declared by:

flake-parts/modules/nixosConfigurations.nix

flake.nixosModules

NixOS modules.

Type: lazy attribute set of unspecified

Default: { }

Declared by:

flake-parts/modules/nixosModules.nix

flake.overlays

An attribute set of overlays.

Note that the overlays themselves are not mergeable. While overlays can be composed, the order of composition is significant, but the module system does not guarantee sufficiently deterministic definition ordering, across versions and when changing imports.

Type: lazy attribute set of function that evaluates to a(n) function that evaluates to a(n) lazy attribute set of unspecified

Default: { }

Example:

{
  default = final: prev: {};
}

Declared by:

flake-parts/modules/overlays.nix

perInput

Function from system to function from flake to system-specific attributes.

Type: function that evaluates to a(n) function that evaluates to a(n) lazy attribute set of unspecified

Declared by:

flake-parts/modules/perSystem.nix

perSystem

A function from system to flake-like attributes omitting the <system> attribute.

Type: module

Declared by:

flake-parts/modules/withSystem.nix, flake-parts/modules/perSystem.nix, flake-parts/modules/packages.nix, flake-parts/modules/legacyPackages.nix, flake-parts/modules/formatter.nix, flake-parts/modules/devShells.nix, flake-parts/modules/checks.nix, flake-parts/modules/apps.nix

perSystem.packages

An attribute set of packages to be built by nix build .#<name>. nix build .#<name> will build packages.<name>.

Type: lazy attribute set of package

Default: { }

Declared by:

flake-parts/modules/packages.nix

perSystem.apps

Programs runnable with nix run .#<name>.

Type: lazy attribute set of submodule

Default: { }

Example:

{
  default.program = "${config.packages.hello}/bin/hello";
}

Declared by:

flake-parts/modules/apps.nix

perSystem.apps.<name>.program

A path to an executable or a derivation with meta.mainProgram.

Type: string or package convertible to it

Declared by:

flake-parts/modules/apps.nix

perSystem.apps.<name>.type

A type tag for apps consumers.

Type: value "app" (singular enum)

Default: "app"

Declared by:

flake-parts/modules/apps.nix

perSystem.checks

Derivations to be built by nix flake check.

Type: lazy attribute set of package

Default: { }

Declared by:

flake-parts/modules/checks.nix

perSystem.devShells

An attribute set of packages to be built by nix develop .#<name>. nix build .#<name> will run devShells.<name>.

Type: lazy attribute set of package

Default: { }

Declared by:

flake-parts/modules/devShells.nix

perSystem.formatter

A package used by nix fmt.

Type: null or package

Default: null

Declared by:

flake-parts/modules/formatter.nix

perSystem.legacyPackages

An attribute set of unmergeable values. This is also used by nix build .#<attrpath>.

Type: lazy attribute set of raw value

Default: { }

Declared by:

flake-parts/modules/legacyPackages.nix

systems

All the system types to enumerate in the flake.

Type: list of string

Declared by:

flake-parts/modules/perSystem.nix

hercules-ci-effects

perSystem

A function from system to flake-like attributes omitting the <system> attribute.

Type: module

Declared by:

hercules-ci-effects/flake-module.nix

perSystem.herculesCIEffects.pkgs

Nixpkgs instance to use for hercules-ci-effects.

The effects functions, etc, will be provided as the effects module argument of perSystem.

Type: raw value

Default: pkgs (module argument)

Declared by:

hercules-ci-effects/flake-module.nix

pre-commit-hooks.nix

perSystem

A function from system to flake-like attributes omitting the <system> attribute.

Type: module

Declared by:

pre-commit-hooks.nix/flake-module.nix

perSystem.pre-commit.installationScript

A bash fragment that sets up pre-commit.

Type: string (read only)

Default: bash statements

Declared by:

pre-commit-hooks.nix/flake-module.nix

perSystem.pre-commit.pkgs

Nixpkgs to use for pre-commit checking.

Type: attribute set of unspecified

Default: pkgs (module argument)

Declared by:

pre-commit-hooks.nix/flake-module.nix

perSystem.pre-commit.settings

Type: submodule

Default: { }

Declared by:

pre-commit-hooks.nix/flake-module.nix

perSystem.pre-commit.settings.package

The pre-commit package to use.

Type: package

Default:

pkgs.pre-commit

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.default_stages

A configuration wide option for the stages property. Installs hooks to the defined stages. Default is empty which falls back to 'commit'. See https://pre-commit.com/#confining-hooks-to-run-at-certain-stages

Type: list of string

Default: [ ]

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.excludes

Exclude files that were matched by these patterns.

Type: list of string

Default: [ ]

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks

The hook definitions.

Type: attribute set of submodule

Default: { }

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.enable

Whether to enable this pre-commit hook.

Type: boolean

Default: false

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.description

Description of the hook. used for metadata purposes only.

Type: string

Default: ""

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.entry

The entry point - the executable to run. entry can also contain arguments that will not be overridden such as entry: autopep8 -i.

Type: string

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.excludes

Exclude files that were matched by these patterns.

Type: list of string

Default: [ ]

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.files

The pattern of files to run on.

Type: string

Default: ""

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.language

The language of the hook - tells pre-commit how to install the hook.

Type: string

Default: "system"

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.name

The name of the hook - shown during hook execution.

Type: string

Default: internal name, same as id

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.pass_filenames

Whether to pass filenames as arguments to the entry point.

Type: boolean

Default: true

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.raw

Raw fields of a pre-commit hook. This is mostly for internal use but exposed in case you need to work around something.

Default: taken from the other hook options.

Type: attribute set of unspecified

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.types

List of file types to run on. See Filtering files with types (https://pre-commit.com/#plugins).

Type: list of string

Default: [ "file" ]

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.hooks.<name>.types_or

List of file types to run on, where only a single type needs to match.

Type: list of string

Default: [ ]

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.installationScript

A bash snippet that installs nix-pre-commit in the current directory

Type: string (read only)

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.rootSrc

The source of the project to be checked.

This is used in the derivation that performs the check.

Type: path

Default: gitignoreSource config.src

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.run

A derivation that tests whether the pre-commit hooks run cleanly on the entire project.

Type: package (read only)

Default: "<derivation>"

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.settings.hpack.silent

Should generation should be silent

Type: boolean

Default: false

Declared by:

pre-commit-hooks.nix/modules/hooks.nix

perSystem.pre-commit.settings.settings.nix-linter.checks

Available checks (See `nix-linter --help-for [CHECK]` for more details)

Type: list of string

Default: [ ]

Declared by:

pre-commit-hooks.nix/modules/hooks.nix

perSystem.pre-commit.settings.settings.ormolu.defaultExtensions

Haskell language extensions to enable

Type: list of string

Default: [ ]

Declared by:

pre-commit-hooks.nix/modules/hooks.nix

perSystem.pre-commit.settings.settings.prettier.binPath

Prettier binary path. E.g. if you want to use the prettier in node_modules, use ./node_modules/.bin/prettier

Type: path

Default:

"${tools.prettier}/bin/prettier"

Declared by:

pre-commit-hooks.nix/modules/hooks.nix

perSystem.pre-commit.settings.src

Root of the project. By default this will be filtered with the gitignoreSource function later, unless rootSrc is specified.

Type: path

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix

perSystem.pre-commit.settings.tools

Tool set from which nix-pre-commit will pick binaries.

nix-pre-commit comes with its own set of packages for this purpose.

Type: lazy attribute set of package

Default: nix-pre-commit-hooks-pkgs.callPackage tools-dot-nix { inherit (pkgs) system; }

Declared by:

pre-commit-hooks.nix/modules/pre-commit.nix