teepot/packages/container-tee-key-preexec-dcap/default.nix
Harald Hoyer eb39705ff1
feat: compat code for non x86_64-linux
- do not build packages, which require `x86_64-linux`
- use Phala `dcap-qvl` crate for remote attestation, if possible
- nix: exclude `nixsgx` on non `x86_64-linux` platforms

Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
2025-04-10 11:57:46 +02:00

40 lines
910 B
Nix

# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Matter Labs
{ teepot
, pkgs
, stdenv
, bash
, coreutils
, container-name ? "teepot-key-preexec-dcap"
, tag ? null
}: let
entrypoint = "${bash}/bin/bash";
in
if (stdenv.hostPlatform.system != "x86_64-linux") then { } else
pkgs.lib.tee.sgxGramineContainer {
name = container-name;
inherit tag entrypoint;
packages = [ teepot.teepot.tee_key_preexec coreutils bash ];
manifest = {
loader = {
argv = [
entrypoint
"-c"
("${teepot.teepot.tee_key_preexec}/bin/tee-key-preexec -- bash -c "
+ "'echo \"SIGNING_KEY=$SIGNING_KEY\"; echo \"TEE_TYPE=$TEE_TYPE\";exec base64 \"$ATTESTATION_QUOTE_FILE_PATH\";'")
];
log_level = "error";
env = {
RUST_BACKTRACE = "1";
RUST_LOG = "trace";
};
};
sgx = {
edmm_enable = true;
max_threads = 2;
};
};
}