From 8d52479bc7843cff0f291dc31da8af4f965e755d Mon Sep 17 00:00:00 2001 From: Jade Date: Mon, 11 Oct 2021 03:56:06 -0400 Subject: [PATCH] nixos/libvirtd: Add configuration option for swtpm --- nixos/modules/virtualisation/libvirtd.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix index c92e1e5750ee..aef04a510ab1 100644 --- a/nixos/modules/virtualisation/libvirtd.nix +++ b/nixos/modules/virtualisation/libvirtd.nix @@ -118,6 +118,13 @@ in { OVMF package to use. ''; }; + qemuSwtpm = mkOption { + type = types.bool; + default = false; + description = '' + Allows libvirtd to use swtpm to create an emulated TPM. + ''; + }; extraOptions = mkOption { type = types.listOf types.str; @@ -257,7 +264,8 @@ in { ] ++ cfg.extraOptions); path = [ cfg.qemuPackage ] # libvirtd requires qemu-img to manage disk images - ++ optional vswitch.enable vswitch.package; + ++ optional vswitch.enable vswitch.package + ++ optional cfg.qemuSwtpm pkgs.swtpm; serviceConfig = { Type = "notify";