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>
This commit is contained in:
Harald Hoyer 2025-03-20 10:25:24 +01:00
parent ed808efd03
commit eb39705ff1
Signed by: harald
GPG key ID: F519A1143B3FBE32
41 changed files with 1531 additions and 519 deletions

View file

@ -2,30 +2,44 @@
# Copyright (c) 2024 Matter Labs
{ dockerTools
, buildEnv
, lib
, stdenv
, teepot
, openssl
, curl
, nixsgx
}:
dockerTools.buildLayeredImage {
name = "verify-attestation-sgx";
if (stdenv.hostPlatform.isDarwin) then {
# FIXME: dockerTools.buildLayeredImage seems to be broken on Darwin
} else
dockerTools.buildLayeredImage {
name = "verify-attestation-sgx";
config.Entrypoint = [ "${teepot.teepot.verify_attestation}/bin/verify-attestation" ];
config.Env = [ "LD_LIBRARY_PATH=/lib" ];
contents = buildEnv {
name = "image-root";
config.Entrypoint = [ "${teepot.teepot.verify_attestation}/bin/verify-attestation" ];
config.Env = [ "LD_LIBRARY_PATH=/lib" ];
contents = buildEnv {
name = "image-root";
paths = with dockerTools; with nixsgx;[
openssl.out
curl.out
sgx-dcap.quote_verify
sgx-dcap.default_qpl
teepot.teepot.verify_attestation
usrBinEnv
binSh
caCertificates
fakeNss
];
pathsToLink = [ "/bin" "/lib" "/etc" "/share" ];
};
}
paths =
with dockerTools;
with nixsgx;
[
openssl.out
curl.out
teepot.teepot.verify_attestation
usrBinEnv
binSh
caCertificates
fakeNss
] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
sgx-dcap.quote_verify
sgx-dcap.default_qpl
];
pathsToLink = [
"/bin"
"/lib"
"/etc"
"/share"
];
};
}