2024-07-03 16:16:24 +02:00
|
|
|
{
|
2024-07-06 17:42:03 +02:00
|
|
|
description = "SignatureProxy SGX Demo";
|
2024-07-03 16:16:24 +02:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, ... }:
|
|
|
|
let
|
|
|
|
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
|
|
|
|
version = builtins.substring 0 8 lastModifiedDate;
|
|
|
|
|
|
|
|
nixpkgsFor = system: import nixpkgs { inherit system; overlays = [ self.overlay ]; };
|
|
|
|
in
|
|
|
|
{
|
|
|
|
overlay = final: prev: with final; {
|
|
|
|
signatureProxy = stdenv.mkDerivation {
|
|
|
|
pname = "SignatureProxy";
|
|
|
|
inherit version;
|
|
|
|
|
2024-07-06 17:42:03 +02:00
|
|
|
src = ./src;
|
|
|
|
|
|
|
|
buildPhase = ''
|
2024-07-03 16:16:24 +02:00
|
|
|
make
|
|
|
|
'';
|
|
|
|
|
2024-07-06 17:42:03 +02:00
|
|
|
installPhase = ''
|
2024-07-03 16:16:24 +02:00
|
|
|
mkdir -p $out/bin
|
2024-07-06 17:42:03 +02:00
|
|
|
cp signatureproxy $out/bin
|
|
|
|
cp enclave.signed.so $out/bin
|
2024-07-03 16:16:24 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
clang
|
|
|
|
glibc
|
|
|
|
sgx-sdk
|
|
|
|
openssl.dev
|
|
|
|
pkg-config
|
2024-07-06 17:42:03 +02:00
|
|
|
which
|
2024-07-03 16:16:24 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
env = {
|
|
|
|
SGX_SDK = pkgs.sgx-sdk;
|
|
|
|
SGX_MODE = "SIM";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
defaultPackage."x86_64-linux" = (nixpkgsFor "x86_64-linux").signatureProxy;
|
|
|
|
};
|
|
|
|
}
|