forked from numtide/treefmt-nix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathperltidy.nix
More file actions
41 lines (38 loc) · 763 Bytes
/
perltidy.nix
File metadata and controls
41 lines (38 loc) · 763 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
{
lib,
config,
mkFormatterModule,
...
}:
let
cfg = config.programs.perltidy;
in
{
meta.maintainers = [ "haruki7049" ];
imports = [
(mkFormatterModule {
name = "perltidy";
package = [
"perlPackages"
"PerlTidy"
];
args = [
"-b"
"-bext='/'"
];
includes = [ "*.pl" ];
})
];
options.programs.perltidy = {
perltidyrc = lib.mkOption {
description = "A path for perltidy's configuration file, usually named .perltidyrc";
type = lib.types.nullOr lib.types.path;
default = null;
};
};
config = lib.mkIf cfg.enable {
settings.formatter.perltidy = {
options = lib.optional (cfg.perltidyrc != null) "-pro=${cfg.perltidyrc}";
};
};
}