forked from IntersectMBO/cardano-ledger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
82 lines (71 loc) · 3.18 KB
/
default.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
{ system ? builtins.currentSystem
, crossSystem ? null
# allows to cutomize haskellNix (ghc and profiling, see ./nix/haskell.nix)
, config ? {}
# allows to override dependencies of the project without modifications,
# eg. to test build against local checkout of iohk-nix:
# nix build -f default.nix cardano-node --arg sourcesOverride '{
# iohk-nix = ../iohk-nix;
# }'
, sourcesOverride ? {}
# pinned version of nixpkgs augmented with overlays (iohk-nix and our packages).
, pkgs ? import ./nix { inherit system crossSystem config sourcesOverride; }
, gitrev ? pkgs.iohkNix.commitIdFromGitRepoOrZero ./.git
}:
with pkgs; with commonLib;
let
haskellPackages = recRecurseIntoAttrs
# we are only interested in listing the project packages:
(selectProjectPackages cardanoLedgerSpecsHaskellPackages);
self = {
inherit haskellPackages check-hydra;
# `tests` are the test suites which have been built.
tests = collectComponents' "tests" haskellPackages;
# `benchmarks` (only built, not run).
benchmarks = collectComponents' "benchmarks" haskellPackages;
libs = collectComponents' "library" haskellPackages;
exes = collectComponents' "exes" haskellPackages;
checks = recurseIntoAttrs {
# `checks.tests` collect results of executing the tests:
tests = collectChecks haskellPackages;
};
shell = import ./shell.nix {
inherit pkgs;
withHoogle = true;
};
roots = cardanoLedgerSpecsHaskellPackages.roots;
#
# PDF builds of LaTeX documentation.
#
# To download the latest PDF build from Hydra, use this link:
# https://hydra.iohk.io/job/Cardano/cardano-ledger/specs.NAME/latest/download/1/NAME.pdf
#
# To get a shell where you can run pdflatex to build it yourself, use:
# nix-shell default.nix -A specs.NAME
#
# To build all specs locally with Nix:
# nix-build -A specs -o spec
#
specs = recurseIntoAttrs {
byron-ledger = pkgs.callPackage ./eras/byron/ledger/formal-spec/default.nix {};
byron-chain = pkgs.callPackage ./eras/byron/chain/formal-spec/default.nix {};
shelley-ledger = pkgs.callPackage ./eras/shelley/formal-spec/default.nix {};
shelley-ma = pkgs.callPackage ./eras/shelley-ma/formal-spec/default.nix {};
alonzo-ledger = pkgs.callPackage ./eras/alonzo/formal-spec/default.nix {};
babbage-ledger = pkgs.callPackage ./eras/babbage/formal-spec/default.nix {};
delegation-design = pkgs.callPackage ./eras/shelley/design-spec/default.nix {};
small-step-semantics = pkgs.callPackage ./docs/small-step-semantics/default.nix {};
pool-ranking = pkgs.callPackage ./docs/pool-ranking/default.nix {};
non-integer-calculations = pkgs.callPackage ./docs/non-integer-calculations/default.nix {};
blocks-cddl = pkgs.callPackage ./eras/byron/cddl-spec/default.nix {};
};
doc = {
site =
let
sphinx-markdown-tables = pkgs.python3Packages.callPackage ./nix/python/sphinx-markdown-tables.nix {};
sphinxemoji = pkgs.python3Packages.callPackage ./nix/python/sphinxemoji.nix {};
in pkgs.callPackage ./doc { inherit sphinx-markdown-tables sphinxemoji; pythonPackages = pkgs.python3Packages; };
};
};
in
self