File tree Expand file tree Collapse file tree 1 file changed +3
-25
lines changed
Expand file tree Collapse file tree 1 file changed +3
-25
lines changed Original file line number Diff line number Diff line change @@ -9,37 +9,15 @@ Flags can be forwarded to the formatter by using `--` followed by the flags.
99Any arguments will be forwarded to the formatter. Typically these are the files to format.
1010
1111
12- # Examples
12+ # Example
1313
14- With [ nixpkgs-fmt ] ( https://github.com/nix-community/nixpkgs-fmt ) :
14+ To use the [ official Nix formatter ] ( https://github.com/NixOS/nixfmt ) :
1515
1616``` nix
1717# flake.nix
1818{
1919 outputs = { nixpkgs, self }: {
20- formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
21- };
22- }
23- ```
24-
25- With [ nixfmt] ( https://github.com/NixOS/nixfmt ) :
26-
27- ``` nix
28- # flake.nix
29- {
30- outputs = { nixpkgs, self }: {
31- formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
32- };
33- }
34- ```
35-
36- With [ Alejandra] ( https://github.com/kamadorueda/alejandra ) :
37-
38- ``` nix
39- # flake.nix
40- {
41- outputs = { nixpkgs, self }: {
42- formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
20+ formatter.x86_64-linux = nixpkgs.legacyPackages.${system}.nixfmt-tree;
4321 };
4422}
4523```
You can’t perform that action at this time.
0 commit comments