Skip to content

Commit d89eee1

Browse files
authored
Add support for ocamlformat (#32)
1 parent c117283 commit d89eee1

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ For an example, see [haskell-template](https://github.com/srid/haskell-template)
7777
* gofmt
7878
* gofumpt
7979
* nixpkgs-fmt
80+
* ocamlformat
8081
* ormolu
8182
* prettier
8283
* purs-tidy

programs/ocamlformat.nix

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
lib,
3+
pkgs,
4+
config,
5+
...
6+
}: let
7+
cfg = config.programs.ocamlformat;
8+
in {
9+
options.programs.ocamlformat = {
10+
enable = lib.mkEnableOption "ocamlformat";
11+
package = lib.mkPackageOption pkgs "ocamlformat" {};
12+
};
13+
14+
config = lib.mkIf cfg.enable {
15+
settings.formatter.ocamlformat = {
16+
command = cfg.package;
17+
options = ["-i"];
18+
includes = ["*.ml" "*.mli"];
19+
};
20+
};
21+
}

0 commit comments

Comments
 (0)