File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change
1
+ cut_body_after = " " # don't include text from the PR body in the merge commit message
2
+ status = [
3
+ " Evaluate flake.nix"
4
+ ]
Original file line number Diff line number Diff line change 16
16
17
17
Use `config.treefmt.build.wrapper` to get access to the resulting treefmt
18
18
package based on this configuration.
19
-
20
- The following sets treefmt up as the default formatter
21
- used by the `nix fmt` command:
22
-
23
- ```
24
- perSystem = { config, ... }: {
25
- formatter = config.treefmt.build.wrapper;
26
- };
27
- ```
19
+
20
+ By default treefmt-nix will set the formatter.<system> attribute of the flake,
21
+ used by the `nix fmt` command.
28
22
'' ;
29
23
type = types . submoduleWith {
30
- modules = ( import ./. ) . all-modules pkgs ;
24
+ modules = ( import ./. ) . all-modules pkgs ++ [ {
25
+ options . flakeFormatter = lib . mkOption {
26
+ type = types . bool ;
27
+ default = true ;
28
+ description = lib . mdDoc ''
29
+ Enables `treefmt` the default formatter used by the `nix fmt` command
30
+ '' ;
31
+ } ;
32
+ } ] ;
31
33
} ;
32
34
} ;
33
35
config = {
34
36
checks . treefmt = config . treefmt . build . check self ;
37
+ formatter = lib . mkIf config . treefmt . flakeFormatter ( lib . mkDefault config . treefmt . build . wrapper ) ;
35
38
} ;
36
39
} ) ;
37
40
} ;
You can’t perform that action at this time.
0 commit comments