nixdots/system/shared/hardware/tpm.nix

27 lines
808 B
Nix
Raw Normal View History

2024-04-12 19:38:05 +00:00
{ config, lib, pkgs, ... }: let
2024-04-12 21:29:29 +00:00
inherit (lib) mkIf mkDefault;
2024-04-12 19:38:05 +00:00
2024-04-12 21:29:29 +00:00
enabled = config.myOptions.device.hasTPM;
2024-04-12 19:38:05 +00:00
in {
config = mkIf enabled {
security.tpm2 = {
# enable Trusted Platform Module 2 support
enable = true;
# enable Trusted Platform 2 userspace resource manager daemon
abrmd.enable = mkDefault false;
# The TCTI is the "Transmission Interface" that is used to communicate with a
# TPM. this option sets TCTI environment variables to the specified values if enabled
# - TPM2TOOLS_TCTI
# - TPM2_PKCS11_TCTI
tctiEnvironment.enable = mkDefault true;
# enable TPM2 PKCS#11 tool and shared library in system path
pkcs11.enable = mkDefault false;
};
environment.systemPackages = with pkgs; [ tpm2-tss tpm2-tools ];
};
}