Systemsicherheit/Assignment 7 - SGX Hands-on/flake.nix

51 lines
1.3 KiB
Nix
Raw Normal View History

{
description = "SignatureProxy SGX Demo";
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;
src = ./src;
buildPhase = ''
make
'';
installPhase = ''
mkdir -p $out/bin
cp signatureproxy $out/bin
cp enclave.signed.so $out/bin
'';
nativeBuildInputs = with pkgs; [
clang
glibc
sgx-sdk
openssl.dev
pkg-config
which
];
env = {
SGX_SDK = pkgs.sgx-sdk;
SGX_MODE = "SIM";
};
};
};
defaultPackage."x86_64-linux" = (nixpkgsFor "x86_64-linux").signatureProxy;
};
}