mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-23 07:54:48 +02:00

This enables to add cargo `fmt`, `clippy` and `deny` to nix, using cached results. Move the `teepot` crate to the `crates` subdir to make the life easier for the `crane` flake. Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
61 lines
1.3 KiB
Nix
61 lines
1.3 KiB
Nix
# SPDX-License-Identifier: Apache-2.0
|
|
# Copyright (c) 2024 Matter Labs
|
|
{ lib
|
|
, inputs
|
|
, makeRustPlatform
|
|
, nixsgx
|
|
, pkg-config
|
|
, rust-bin
|
|
, pkgs
|
|
, ...
|
|
}:
|
|
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 = [
|
|
nixsgx.sgx-sdk
|
|
nixsgx.sgx-dcap
|
|
nixsgx.sgx-dcap.quote_verify
|
|
];
|
|
|
|
strictDeps = true;
|
|
src = with lib.fileset; toSource {
|
|
root = ../../.;
|
|
fileset = unions [
|
|
../../Cargo.lock
|
|
../../Cargo.toml
|
|
../../bin
|
|
../../crates
|
|
../../rust-toolchain.toml
|
|
../../deny.toml
|
|
../../taplo.toml
|
|
];
|
|
};
|
|
|
|
RUSTFLAGS = "--cfg mio_unsupported_force_waker_pipe";
|
|
checkType = "debug";
|
|
};
|
|
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
|
|
pname = "teepot-workspace";
|
|
inherit NIX_OUTPATH_USED_AS_RANDOM_SEED;
|
|
});
|
|
NIX_OUTPATH_USED_AS_RANDOM_SEED = "aaaaaaaaaa";
|
|
in
|
|
{
|
|
inherit rustPlatform
|
|
rustVersion
|
|
commonArgs
|
|
craneLib
|
|
cargoArtifacts;
|
|
NIX_OUTPATH_USED_AS_RANDOM_SEED = "aaaaaaaaaa";
|
|
}
|