2024-11-19 10:31:29 +01:00
|
|
|
{
|
|
|
|
options,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-03-21 15:00:36 +01:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
with lib.metacfg;
|
|
|
|
let
|
|
|
|
cfg = config.metacfg.aesmd_dcap;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.metacfg.aesmd_dcap = with types; {
|
|
|
|
enable = mkBoolOpt false "Whether or not to enable aesmd in dcap mode.";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
metacfg = {
|
|
|
|
nix.extra-substituters = {
|
2024-06-28 14:33:05 +02:00
|
|
|
"https://attic.teepot.org/tee-pot".key = "tee-pot:SS6HcrpG87S1M6HZGPsfo7d1xJccCGev7/tXc5+I4jg=";
|
2024-03-21 15:00:36 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
services.aesmd = {
|
|
|
|
enable = true;
|
|
|
|
quoteProviderLibrary = pkgs.nixsgx.sgx-dcap.default_qpl;
|
|
|
|
};
|
|
|
|
systemd.services.aesmd = {
|
2024-11-19 10:31:29 +01:00
|
|
|
environment.LD_LIBRARY_PATH = lib.mkForce (
|
|
|
|
lib.makeLibraryPath [
|
|
|
|
pkgs.nixsgx.sgx-dcap.default_qpl
|
|
|
|
pkgs.curl.out
|
|
|
|
]
|
|
|
|
);
|
2024-05-21 15:44:00 +02:00
|
|
|
serviceConfig = {
|
2024-11-19 10:31:29 +01:00
|
|
|
BindReadOnlyPaths = [ "/etc/sgx_default_qcnl.conf" ];
|
|
|
|
BindPaths = [ "/dev/log" ];
|
2024-05-21 15:44:00 +02:00
|
|
|
};
|
2024-03-21 15:00:36 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|