-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathshell.nix
More file actions
67 lines (63 loc) · 1.62 KB
/
shell.nix
File metadata and controls
67 lines (63 loc) · 1.62 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ withHoogle ? true, withCommitHook ? true }:
with (import ./. { });
let
python-commit-hooks =
pkgs.python3Packages.pre-commit-hooks.overridePythonAttrs
(_: { doCheck = false; });
pre-commit-hooks = import sources.pre-commit-hooks;
pre-commit-config = if withCommitHook then {
src = ./.;
tools = pkgs;
settings = {
ormolu = {
defaultExtensions = [
"TypeApplications"
"BangPatterns"
"CPP"
"QuasiQuotes"
"TemplateHaskell"
];
};
};
hooks = {
ormolu.enable = true;
hlint.enable = true;
yamllint.enable = true;
nixfmt = {
enable = true;
excludes = [ "nix/default.nix" ];
};
trailing-whitespace = {
enable = true;
name = "trailing-whitespace";
entry = "${python-commit-hooks}/bin/trailing-whitespace-fixer";
types = [ "text" ];
};
end-of-file = {
enable = true;
name = "end-of-file";
entry = "${python-commit-hooks}/bin/end-of-file-fixer";
types = [ "text" ];
};
};
} else {
src = ./.;
};
pre-commit-check = pre-commit-hooks.run pre-commit-config;
# hls = (builtins.getFlake "github:haskell/haskell-language-server/2.0.0.0").packages.${builtins.currentSystem}.haskell-language-server-927;
in haskellPkgs.shellFor {
packages = p: with p; [ p.instrument p.instrument-cloudwatch ];
inherit withHoogle;
nativeBuildInputs = with pkgs; [
cabal-install
ghcid
# hls
hlint
hpack
niv
ormolu
];
shellHook = ''
{ ${pre-commit-check.shellHook} } 2> /dev/null
'';
}