forked from kadena-io/chainweb-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
49 lines (47 loc) · 1.57 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
{
description = "Chainweb";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?rev=4d2b37a84fad1091b9de401eb450aae66f1a741e";
hackage = {
url = "github:input-output-hk/hackage.nix";
flake = false;
};
haskellNix = {
url = "github:input-output-hk/haskell.nix";
inputs.hackage.follows = "hackage";
};
flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
};
outputs = { self, nixpkgs, flake-utils, haskellNix, nix-filter, ... }:
flake-utils.lib.eachSystem
[ "x86_64-linux" "x86_64-darwin"
"aarch64-linux" "aarch64-darwin" ] (system:
let
pkgs = import nixpkgs {
inherit system;
inherit (haskellNix) config;
overlays = [ haskellNix.overlay ];
};
defaultNix = import ./default.nix {
inherit pkgs nix-filter;
flakePath = self.outPath;
};
flake = defaultNix.flake;
executables = defaultNix.default;
# This package depends on other packages at buildtime, but its output does not
# depend on them. This way, we don't have to download the entire closure to verify
# that those packages build.
mkCheck = name: package: pkgs.runCommand ("check-"+name) {} ''
echo ${name}: ${package}
echo works > $out
'';
in nixpkgs.lib.recursiveUpdate flake {
packages.default = executables;
packages.check = pkgs.runCommand "check" {} ''
echo ${mkCheck "chainweb" executables}
echo ${mkCheck "devShell" flake.devShell}
echo works > $out
'';
});
}