-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
69 lines (59 loc) · 2 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
{
description = "zkVMs benchmarks";
nixConfig = {
extra-substituters = "https://nix-blockchain-development.cachix.org";
extra-trusted-public-keys = "nix-blockchain-development.cachix.org-1:Ekei3RuW3Se+P/UIo6Q/oAgor/fVhFuuuX5jR8K/cdg=";
};
inputs = {
mcl-blockchain.url = "github:metacraft-labs/nix-blockchain-development";
nixpkgs.follows = "mcl-blockchain/nixpkgs";
crane.follows = "mcl-blockchain/crane";
rust-overlay.follows = "mcl-blockchain/rust-overlay";
# flake-utils.follows = "mcl-blockchain/flake-utils";
};
outputs = { self, nixpkgs, mcl-blockchain, crane, rust-overlay, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { system = system; overlays = [
mcl-blockchain.overlays.default
rust-overlay.overlays.default
];
};
craneLib-default = crane.mkLib pkgs;
callPackage = pkgs.lib.callPackageWith pkgs;
zkvms = builtins.attrNames
(pkgs.lib.filterAttrs
(_: type: type == "directory")
(builtins.readDir ./zkvms));
guests = [ null ] ++ (builtins.attrNames
(pkgs.lib.filterAttrs
(_: type: type == "directory")
(builtins.readDir ./guests)));
foldr = pkgs.lib.foldr;
createPackages = guestName: let
guest = if guestName == null then "graph_coloring" else guestName;
postfix = if guestName == null then "" else "/" + guest;
args-zkVM = {
inherit craneLib-default;
zkvmLib = (import ./zkvmLib.nix) pkgs guest;
};
in foldr
(host: accum: accum // {
"${host}${postfix}" = callPackage ./zkvms/${host}/default.nix args-zkVM;
})
{}
zkvms;
hostPackages = foldr
(guest: accum: accum // (createPackages guest))
{}
guests;
guestPackages = foldr
(guest: accum: accum // {
${guest} = callPackage ./guest.nix { inherit guest; inherit zkvms; inherit hostPackages; };
})
{}
guests;
in {
packages.${system} = hostPackages // guestPackages;
};
}