mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 15:13:56 +02:00

- Included `nixsgx.sgx-dcap.libtdx_attest` in the dependencies list. - Ensures support for TDX attestation in the build environment.
66 lines
1.2 KiB
Nix
66 lines
1.2 KiB
Nix
# 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
|
|
nixsgx.sgx-dcap.libtdx_attest
|
|
];
|
|
|
|
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;
|
|
}
|