-
Notifications
You must be signed in to change notification settings - Fork 3
/
shell.nix
94 lines (91 loc) · 2.38 KB
/
shell.nix
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{ sources ? import ./nix/sources.nix { }
, ghc ? "ghc8107"
}:
let
haskellNix = import sources.haskellNix { };
pkgs = import haskellNix.sources.nixpkgs-unstable haskellNix.nixpkgsArgs;
hsPkgs = import ./base.nix { inherit pkgs ghc; };
floskell = (
pkgs.haskell-nix.hackage-package
{
compiler-nix-name = ghc;
name = "floskell";
version = "latest";
modules = [
{
packages.floskell.ghcOptions = [ "-threaded" "-with-rtsopts=-N" ];
}
];
}
).components.exes.floskell;
nix-pre-commit-hooks = import "${sources."pre-commit-hooks.nix"}/nix" { nixpkgs = haskellNix.sources.nixpkgs-unstable; };
pre-commit-check = nix-pre-commit-hooks.run {
src = ./.;
hooks = with import ./nix/commit-hooks.nix { inherit pkgs floskell; }; {
nixpkgs-fmt.enable = true;
nix-linter.enable = true;
hlint.enable = true;
prettier = {
enable = true;
files = "www/.*\\.css|.*\\.md$";
};
floskell = floskellHook // {
enable = true;
};
build = buildHook // {
enable = true;
};
floskellConfigChange = floskellConfigChangeHook // {
enable = true;
};
weeder = weederHook // {
enable = true;
};
};
};
in
hsPkgs.shellFor {
tools = {
cabal = "3.4.0.0";
hlint = "latest";
stan = "latest";
};
buildInputs = with pkgs; [
floskell
ghcid
stack
git # required by pre-commit-check shell hook
dhall-lsp-server
(
pkgs.haskell-nix.hackage-package
{
compiler-nix-name = ghc;
name = "weeder";
version = "2.2.0";
}
).components.exes.weeder
(
pkgs.haskell-nix.hackage-package
{
compiler-nix-name = ghc;
name = "apply-refact";
version = "latest";
}
).components.exes.refactor
(
pkgs.haskell-nix.hackage-package
{
compiler-nix-name = ghc;
name = "haskell-language-server";
version = "latest";
configureArgs = "-frename --allow-newer=hls-rename-plugin:ghcide";
}
).components.exes.haskell-language-server
] ++ builtins.attrValues (import ./nix/scripts.nix { inherit pkgs floskell; });
withHoogle = false;
exactDeps = false;
shellHook = ''
${pre-commit-check.shellHook}
'';
STACK_YAML = "nix-stack.yaml";
}