Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
fmt

R""(

Description

nix fmt calls the formatter specified in the flake.

Flags can be forwarded to the formatter by using -- followed by the flags.

Any arguments will be forwarded to the formatter. Typically these are the files to format.

Examples

With nixpkgs-fmt:

# flake.nix
{
outputs = { nixpkgs, self }: {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
};
}

With nixfmt:

# flake.nix
{
outputs = { nixpkgs, self }: {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
};
}

With Alejandra:

# flake.nix
{
outputs = { nixpkgs, self }: {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
};
}

)""