This repository has been archived by the owner on Apr 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
62 lines (53 loc) · 1.96 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
############################################################################
# iohk-skeleton Nix build
#
# fixme: document top-level attributes and how to build them
#
############################################################################
{ system ? builtins.currentSystem
, crossSystem ? null
# allows to cutomize 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 nixpkgs and iohk-nix:
# nix build -f default.nix iohk-skeleton --arg sourcesOverride '{
# iohk-nix = ../iohk-nix;
# nixpkgs = ../nixpkgs;
# }'
, sourcesOverride ? {}
# pinned version of nixpkgs augmented with iohk overlays.
, pkgs ? import ./nix {
inherit system crossSystem config sourcesOverride;
}
}:
# commonLib include iohk-nix utilities, our util.nix and nixpkgs lib.
with pkgs; with commonLib;
let
haskellPackages = recRecurseIntoAttrs
# the Haskell.nix package set, reduced to local packages.
(selectProjectPackages skeletonHaskellPackages);
self = {
inherit haskellPackages check-hydra;
inherit (haskellPackages.iohk-skeleton.identifier) version;
# Grab the executable component of our package.
inherit (haskellPackages.iohk-skeleton.components.exes)
iohk-skeleton;
# `tests` are the test suites which have been built.
tests = collectComponents' "tests" haskellPackages;
# `benchmarks` (only built, not run).
benchmarks = collectComponents' "benchmarks" haskellPackages;
checks = recurseIntoAttrs {
# `checks.tests` collect results of executing the tests:
tests = collectChecks haskellPackages;
# Example of a linting script used by Buildkite.
lint-fuzz = callPackage ./nix/check-lint-fuzz.nix {};
};
shell = import ./shell.nix {
inherit pkgs;
withHoogle = true;
};
# Attrset of PDF builds of LaTeX documentation.
docs = pkgs.callPackage ./docs/default.nix {};
};
in
self