-
Notifications
You must be signed in to change notification settings - Fork 163
Expand file tree
/
Copy patherlfmt.nix
More file actions
46 lines (43 loc) · 754 Bytes
/
erlfmt.nix
File metadata and controls
46 lines (43 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
lib,
config,
mkFormatterModule,
...
}:
let
cfg = config.programs.erlfmt;
in
{
meta.maintainers = [ ];
imports = [
(mkFormatterModule {
name = "erlfmt";
args = [ "--write" ];
includes = [
"*.erl"
"*.hrl"
"*.app"
"*.app.src"
"*.config"
"*.script"
"*.escript"
];
})
];
options.programs.erlfmt = {
print-width = lib.mkOption {
description = "The line length that formatter would wrap on";
type = lib.types.int;
example = 80;
default = 100;
};
};
config = lib.mkIf cfg.enable {
settings.formatter.erlfmt = {
options = [
"--print-width"
(toString cfg.print-width)
];
};
};
}