/
default.nix
69 lines (59 loc) · 2.46 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
############################################################################
# cardano-repo-tool Nix build
#
# fixme: document top-level attributes and how to build them
#
############################################################################
{ system ? builtins.currentSystem
, crossSystem ? null
, config ? {}
# Import IOHK common nix lib
, iohkLib ? import ./nix/iohk-common.nix { inherit system crossSystem config; }
# Use nixpkgs pin from iohkLib
, pkgs ? iohkLib.pkgs
}:
let
haskell = pkgs.callPackage iohkLib.nix-tools.haskell {};
src = iohkLib.cleanSourceHaskell ./.;
util = pkgs.callPackage ./nix/util.nix {};
# Example of using a package from iohk-nix
# TODO: Declare packages required by the build.
inherit (iohkLib.rust-packages.pkgs) jormungandr;
# Import the Haskell package set.
haskellPackages = import ./nix/pkgs.nix {
inherit pkgs haskell src;
# Pass in any extra programs necessary for the build as function arguments.
# TODO: Declare packages required by the build.
# jormungandr and cowsay are just examples and should be removed for your
# project, unless needed.
inherit jormungandr;
inherit (pkgs) cowsay;
# Provide cross-compiling secret sauce
inherit (iohkLib.nix-tools) iohk-extras iohk-module;
};
in {
inherit pkgs iohkLib src haskellPackages;
inherit (haskellPackages.cardano-repo-tool.identifier) version;
# Grab the executable component of our package.
inherit (haskellPackages.cardano-repo-tool.components.exes) cardano-repo-tool;
tests = util.collectComponents "tests" util.isIohkSkeleton haskellPackages;
benchmarks = util.collectComponents "benchmarks" util.isIohkSkeleton haskellPackages;
# This provides a development environment that can be used with nix-shell or
# lorri. See https://input-output-hk.github.io/haskell.nix/user-guide/development/
shell = haskellPackages.shellFor {
name = "cardano-repo-tool-shell";
# TODO: List all local packages in the project.
packages = ps: with ps; [
cardano-repo-tool
];
# These programs will be available inside the nix-shell.
buildInputs =
with pkgs.haskellPackages; [ hlint stylish-haskell weeder ghcid lentil ]
# TODO: Add your own packages to the shell.
++ [ jormungandr ];
};
# Example of a linting script used by Buildkite.
checks.lint-fuzz = pkgs.callPackage ./nix/check-lint-fuzz.nix {};
# Attrset of PDF builds of LaTeX documentation.
docs = pkgs.callPackage ./docs/default.nix {};
}