-
Notifications
You must be signed in to change notification settings - Fork 11
/
teepot-crate.nix
65 lines (60 loc) · 1.18 KB
/
teepot-crate.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
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Matter Labs
{ lib
, inputs
, makeRustPlatform
, nixsgx
, pkg-config
, rust-bin
, pkgs
, src
, openssl
}:
let
rustVersion = rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
rustPlatform = makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};
craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustVersion;
commonArgs = {
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = [
openssl
nixsgx.sgx-sdk
nixsgx.sgx-dcap
nixsgx.sgx-dcap.quote_verify
];
strictDeps = true;
src = with lib.fileset; toSource {
root = src;
fileset = unions [
./Cargo.lock
./Cargo.toml
./bin
./crates
./rust-toolchain.toml
./deny.toml
./taplo.toml
];
};
checkType = "debug";
env = {
OPENSSL_NO_VENDOR = "1";
NIX_OUTPATH_USED_AS_RANDOM_SEED = "aaaaaaaaaa";
};
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
pname = "teepot-workspace";
});
in
{
inherit rustPlatform
rustVersion
commonArgs
craneLib
cargoArtifacts;
}