summary refs log tree commit diff
path: root/nixos/modules/services/security/aesmd.nix
diff options
context:
space:
mode:
authorAndreas Stührk <andy@hammerhartes.de>2022-11-25 19:20:39 +0100
committerVincent Haupert <mail@vincent-haupert.de>2022-12-04 20:12:50 +0100
commitda0dc8339ceca52b962d91e56d8764fcdc0ecdd8 (patch)
tree82fc037de8b5b99c2f2ebcc9fc85e21ac41452c8 /nixos/modules/services/security/aesmd.nix
parent7de32b0ce90bc507479ce6a4d83602c51e9eeb47 (diff)
downloadnixpkgs-da0dc8339ceca52b962d91e56d8764fcdc0ecdd8.tar
nixpkgs-da0dc8339ceca52b962d91e56d8764fcdc0ecdd8.tar.gz
nixpkgs-da0dc8339ceca52b962d91e56d8764fcdc0ecdd8.tar.bz2
nixpkgs-da0dc8339ceca52b962d91e56d8764fcdc0ecdd8.tar.lz
nixpkgs-da0dc8339ceca52b962d91e56d8764fcdc0ecdd8.tar.xz
nixpkgs-da0dc8339ceca52b962d91e56d8764fcdc0ecdd8.tar.zst
nixpkgs-da0dc8339ceca52b962d91e56d8764fcdc0ecdd8.zip
nixos/aesmd: add option to configure quote provider library
Changes sgx-psw to append `aesm` to `LD_LIBRARY_PATH`:
- Append instead of prepend to allow for overriding in service config
- As we already add a wrapper to add `aesm` to `LD_LIBRARY_PATH` it is
  not necessary to also set in `LD_LIBRARY_PATH` of the systemd service.

Co-authored-by: Vincent Haupert <mail@vincent-haupert.de>
Diffstat (limited to 'nixos/modules/services/security/aesmd.nix')
-rw-r--r--nixos/modules/services/security/aesmd.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/nixos/modules/services/security/aesmd.nix b/nixos/modules/services/security/aesmd.nix
index 7b0a46d6d02..f44dcb0de8a 100644
--- a/nixos/modules/services/security/aesmd.nix
+++ b/nixos/modules/services/security/aesmd.nix
@@ -25,6 +25,12 @@ in
       default = false;
       description = lib.mdDoc "Whether to build the PSW package in debug mode.";
     };
+    quoteProviderLibrary = mkOption {
+      type = with types; nullOr path;
+      default = null;
+      example = literalExpression "pkgs.sgx-azure-dcap-client";
+      description = lib.mdDoc "Custom quote provider library to use.";
+    };
     settings = mkOption {
       description = lib.mdDoc "AESM configuration";
       default = { };
@@ -83,7 +89,6 @@ in
         storeAesmFolder = "${sgx-psw}/aesm";
         # Hardcoded path AESM_DATA_FOLDER in psw/ae/aesm_service/source/oal/linux/aesm_util.cpp
         aesmDataFolder = "/var/opt/aesmd/data";
-        aesmStateDirSystemd = "%S/aesmd";
       in
       {
         description = "Intel Architectural Enclave Service Manager";
@@ -98,7 +103,7 @@ in
         environment = {
           NAME = "aesm_service";
           AESM_PATH = storeAesmFolder;
-          LD_LIBRARY_PATH = storeAesmFolder;
+          LD_LIBRARY_PATH = makeLibraryPath [ cfg.quoteProviderLibrary ];
         };
 
         # Make sure any of the SGX application enclave devices is available