-
Notifications
You must be signed in to change notification settings - Fork 17
/
flake.nix
77 lines (74 loc) · 2.44 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
{
description = "Nix flake for zkllvm-blueprint";
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";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { self, nixpkgs, nil-crypto3, flake-utils, nix-3rdparty }:
(flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
stdenv = pkgs.llvmPackages_16.stdenv;
crypto3 = nil-crypto3.packages.${system}.crypto3;
cmake_modules = nix-3rdparty.packages.${system}.cmake_modules;
in {
packages = rec {
zkllvm-blueprint = (pkgs.callPackage ./zkllvm-blueprint.nix {
src_repo = self;
crypto3 = crypto3;
cmake_modules = cmake_modules;
});
zkllvm-blueprint-debug = (pkgs.callPackage ./zkllvm-blueprint.nix {
src_repo = self;
crypto3 = crypto3;
cmake_modules = cmake_modules;
enableDebug = true;
});
zkllvm-blueprint-debug-tests = (pkgs.callPackage ./zkllvm-blueprint.nix {
src_repo = self;
crypto3 = crypto3;
cmake_modules = cmake_modules;
enableDebug = true;
runTests = true;
});
default = zkllvm-blueprint-debug-tests;
};
checks = rec {
gcc = (pkgs.callPackage ./zkllvm-blueprint.nix {
src_repo = self;
crypto3 = crypto3;
cmake_modules = cmake_modules;
runTests = true;
});
clang = (pkgs.callPackage ./zkllvm-blueprint.nix {
stdenv = pkgs.llvmPackages_18.stdenv;
src_repo = self;
crypto3 = crypto3;
cmake_modules = cmake_modules;
runTests = true;
});
all = pkgs.symlinkJoin {
name = "all";
paths = [ gcc clang ];
};
default = all;
};
}));
}
# `nix flake -L check` to run all tests (-L to output build logs)
# `nix flake show` to show derivations tree
# If build fails due to OOM, run `export NIX_CONFIG="cores = 2"` to set desired parallel level