flake/nixos/modules/my/hardware/tpm.nix

21 lines
331 B
Nix
Raw Normal View History

2024-06-15 17:17:50 +00:00
{
lib,
config,
...
}: let
cfg = config.my.hardware.tpm;
in {
options = {
my.hardware.tpm.enable = lib.mkEnableOption "TPM";
};
# https://nixos.wiki/wiki/TPM
config = lib.mkIf cfg.enable {
security.tpm2 = {
enable = true;
pkcs11.enable = true;
tctiEnvironment.enable = true;
};
};
}