-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
71 lines (59 loc) · 2.21 KB
/
flake.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
{
description = "Hydra demo";
inputs = {
# based on https://github.com/input-output-hk/hydra-poc/blob/0.5.0/default.nix
haskellNix.url = "github:input-output-hk/haskell.nix/28dbf2f4bd32a4fbd1a2e9de45d02ad977b062d9";
iohkNix.url = "github:input-output-hk/iohk-nix/62d853d3216083ecadc8e7f192498bebad4eee76";
nixpkgs.follows = "haskellNix/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, haskellNix, iohkNix, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system overlays;
inherit (haskellNix) config;
};
overlays = [
haskellNix.overlay
# needed for cardano-api which uses a patched libsodium
iohkNix.overlays.crypto
(final: prev: {
hydraDemoProject = final.haskell-nix.project' {
compiler-nix-name = "ghc8107";
src = final.haskell-nix.haskellLib.cleanGit {
name = "hydra-demo";
src = ./.;
};
modules = [{
# https://github.com/input-output-hk/iohk-nix/pull/488
packages.cardano-crypto-class.components.library.pkgconfig = final.lib.mkForce [ [ final.libsodium-vrf ] ];
packages.cardano-crypto-praos.components.library.pkgconfig = final.lib.mkForce [ [ final.libsodium-vrf ] ];
}];
shell = {
nativeBuildInputs = with final; [
nixpkgs-fmt
git
];
tools = {
cabal = { };
cabal-fmt = { };
fourmolu = "0.4.0.0";
hlint = { };
};
};
};
})
];
flake = pkgs.hydraDemoProject.flake { };
exe-component-name = "hydra-demo:exe:hydra-rps-game";
in
flake // {
defaultPackage = flake.packages.${exe-component-name};
defaultApp = flake.apps.${exe-component-name};
check = pkgs.runCommand "combined-test"
{
nativeBuildInputs = builtins.attrValues flake.checks;
} "touch $out";
});
}