A few tweaks to try TPM improvement

This commit is contained in:
Greg Hellings
2024-12-10 09:57:19 -06:00
parent 8335f1831b
commit be2ea6aab3
3 changed files with 62 additions and 9 deletions
+50 -5
View File
@@ -3,11 +3,6 @@
{
greg.vmdev.enable = true;
virtualisation = {
waydroid.enable = false;
lxd.enable = false;
};
systemd.services = {
gitlab-runner = {
conflicts = [ "libvirtd.service" ];
@@ -35,4 +30,54 @@
};
};
};
virtualisation = {
libvirtd.hooks.qemu = {
"win11-prepare-begin-bind_vfio.sh" = pkgs.writeShellApplication {
name = "bind_vfio.sh";
runtimeInputs = with pkgs; [
kmod
libvirt
];
text = ''
guest="$1"
stage="$2"
state="$3"
if [ "$guest" == "win11" ] && [ "$stage" == "prepare" ] && [ "$state" == "begin" ]; then
for f in vfio vfio_iommu_type1 vfio_pci; do
modprobe "$f"
done
virsh nodedev-detach pci_0000_10_00_0
virsh nodedev-detach pci_0000_10_00_1
fi
'';
};
"win11-release-end-unbind_vfio.sh" = pkgs.writeShellApplication {
name = "unbind_vfio.sh";
runtimeInputs = with pkgs; [
kmod
libvirt
];
text = ''
guest="$1"
stage="$2"
state="$3"
if [ "$guest" == "win11" ] && [ "$stage" == "release" ] && [ "$state" == "end" ]; then
virsh nodedev-reattach pci_0000_10_00_1
virsh nodedev-reattach pci_0000_10_00_0
for f in vfio_pci vfio_iommu_type1 vfio; do
modprobe -r "$f"
done
fi
'';
};
};
lxd.enable = false;
waydroid.enable = false;
};
}