-
Notifications
You must be signed in to change notification settings - Fork 48
/
flake.nix
107 lines (103 loc) · 3.03 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
description = "Nix flake for zkLLVM";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
nix-3rdparty = {
url = "github:NilFoundation/nix-3rdparty";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
nil-crypto3 = {
url = "https://github.com/NilFoundation/crypto3";
type = "git";
submodules = false;
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
nil-zkllvm-blueprint = {
url = "https://github.com/NilFoundation/zkllvm-blueprint";
type = "git";
submodules = true;
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
nil-crypto3.follows = "nil-crypto3";
};
};
};
outputs = { self
, nixpkgs
, flake-utils
, nix-3rdparty
, nil-crypto3
, nil-zkllvm-blueprint
}:
(flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ nix-3rdparty.overlays.${system}.default ];
};
crypto3 = nil-crypto3.packages.${system}.crypto3;
blueprint = nil-zkllvm-blueprint.packages.${system}.default;
in {
packages = rec {
inherit pkgs crypto3 blueprint;
zkllvm = (pkgs.callPackage ./zkllvm.nix {
src_repo = self;
crypto3 = crypto3;
blueprint = blueprint;
});
debug = (pkgs.callPackage ./zkllvm.nix {
src_repo = self;
enableDebug = true;
crypto3 = crypto3;
blueprint = blueprint;
});
release = zkllvm;
default = debug;
};
checks = rec {
release-tests = (pkgs.callPackage ./zkllvm.nix {
src_repo = self;
crypto3 = crypto3;
blueprint = blueprint;
enableTesting = true;
});
debug-tests = (pkgs.callPackage ./zkllvm.nix {
src_repo = self;
enableDebug = true;
crypto3 = crypto3;
blueprint = blueprint;
enableTesting = true;
});
default = debug-tests;
};
apps = {
assigner = {
type = "app";
program = "${self.packages.${system}.default}/bin/assigner";
};
clang = {
type = "app";
program = "${self.packages.${system}.default}/bin/clang";
};
transpiler = {
type = "app";
program = "${self.packages.${system}.default}/bin/transpiler";
};
};
}));
}
# To override some inputs:
# nix build --override-input nil-crypto3 /your/local/path/crypto3/
# to configure build:
# nix develop . -c cmake -B build -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=FALSE -DCMAKE_ENABLE_TESTS=TRUE
# to build:
# cd build
# nix develop ../ -c cmake --build . -t compile_cpp_examples