-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-module-graph.nix
35 lines (34 loc) · 1.01 KB
/
generate-module-graph.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
let pkgs = import ./nix/pkgs.nix; in
pkgs.runCommand "module-graph"
{
moduleSources = ./.;
graphviz = pkgs.graphviz;
graphmod = pkgs.haskellPackages.graphmod;
}
''
mkdir -p $out
cd $moduleSources
$graphmod/bin/graphmod \
-p \
-a \
--remove-module=Control.Applicative \
--remove-module=Control.Monad \
--remove-module=Control.Monad \
--remove-module=Data.Coerce \
--remove-module=Data.Set \
--remove-module=Data.Map \
--remove-module=Data.Kind \
--remove-module=Data.Functor \
--remove-module=Data.Maybe \
--remove-module=RIO \
--remove-module=Control.Monad.Reader \
--remove-module=Main \
--remove-module=System.Environment \
--remove-module=GHC.Stack \
--remove-module=GHC.Stats \
--no-module-in-cluster \
-i src \
> $out/module-graph.dot
cd $out
$graphviz/bin/dot -Tpng -Gsize=4,5 -Gdpi=200 -o $out/module-graph.png $out/module-graph.dot
''