-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdefault.nix
More file actions
36 lines (33 loc) · 1.01 KB
/
Copy pathdefault.nix
File metadata and controls
36 lines (33 loc) · 1.01 KB
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
{
sources ? import ./nix/sources.nix,
pkgs ? import sources.nixpkgs { },
}:
let
haskellPackages = pkgs.haskellPackages;
in
pkgs.haskell.lib.overrideCabal (haskellPackages.callCabal2nix "taskwarrior" ./. { }) {
testToolDepends = builtins.attrValues {
inherit (pkgs) cabal-install hlint fourmolu;
inherit (pkgs.haskellPackages) cabal-gild;
};
postPatch = ''
echo "Checking hlint hints …"
hlint src
echo "hlint hints okay."
echo "Checking formatting with fourmolu …"
fourmolu -m check src/**/*.hs
echo "Formatting okay."
echo "Checking formatting with cabal-gild …"
cabal-gild -m check -i taskwarrior.cabal
echo "Formatting okay."
sed -i "s/-Wall/-Wall -Werror/" taskwarrior.cabal
'';
postHaddock = ''
echo "Checking that documentation is complete …"
if [[ ! -z $(./Setup haddock | grep "\(is out of scope\|Missing documentation\)") ]]; then
echo "Detected missing documentation."
exit 1;
fi
echo "Documentation checked."
'';
}