Skip to content

Commit d5ed9a1

Browse files
authored
feat: add programs.hlint (#33)
style checker for haskell
1 parent b83893c commit d5ed9a1

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ For an example, see [haskell-template](https://github.com/srid/haskell-template)
7676
* elm-format
7777
* gofmt
7878
* gofumpt
79+
* hlint
7980
* nixpkgs-fmt
8081
* ocamlformat
8182
* ormolu

programs/hlint.nix

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

0 commit comments

Comments
 (0)