forked from IntersectMBO/ouroboros-network
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
71 lines (61 loc) · 2.49 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
{ system ? builtins.currentSystem, crossSystem ? null
# allows to cutomize haskellNix (profiling, see ./nix/ouroboros-network.nix)
, config ? { }
# allows to override dependencies of the project without modifications,
# eg. to test build against local checkout of nixpkgs and iohk-nix:
# nix build -f default.nix cardano-ledger-byron --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
# the Haskell.nix package set, reduced to local packages.
(selectProjectPackages ouroborosNetworkHaskellPackages);
validate-mainnet = import ./nix/validate-mainnet.nix {
inherit pkgs;
byron-db-converter =
haskellPackages.ouroboros-consensus-byron.components.exes.db-converter;
db-analyser =
haskellPackages.ouroboros-consensus-cardano.components.exes.db-analyser;
onlyImmutableDB = false;
};
self = {
inherit haskellPackages network-docs consensus-docs;
inherit (haskellPackages.ouroboros-network.identifier) version;
# `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;
styles = recurseIntoAttrs {
check-nixfmt = callPackage ./nix/check-nixfmt.nix { };
check-stylish = callPackage ./nix/check-stylish.nix { };
check-stylish-network = callPackage ./nix/check-stylish-network.nix { };
};
};
# These are not run on hydra, but will be built separately in a nightly
# build job.
nightly-checks = {
inherit validate-mainnet;
gnuparallel = pkgs.parallel;
glibcLocales = pkgs.glibcLocales;
Cardano =
haskellPackages.ouroboros-consensus-cardano-test.components.tests.test;
Shelley =
haskellPackages.ouroboros-consensus-shelley-test.components.tests.test;
};
shell = import ./shell.nix {
inherit pkgs;
withHoogle = true;
};
};
in self