2022-06-23 02:57:41 -04:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
nw = config.nathan.hardware;
|
|
|
|
in
|
|
|
|
with lib;
|
|
|
|
{
|
2022-10-09 21:43:38 -04:00
|
|
|
config = mkMerge [
|
|
|
|
{
|
|
|
|
hardware.logitech.wireless = mkIf nw.logitech {
|
|
|
|
enable = true;
|
|
|
|
enableGraphical = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
(mkIf nw.amdPassthrough {
|
|
|
|
# Turn on IOMMU and the needed drivers
|
|
|
|
boot = {
|
|
|
|
kernelParams = [ "amd_iommu=on" ];
|
|
|
|
kernelModules = [ "kvm-amd" "vifo-pci" ];
|
|
|
|
};
|
|
|
|
# Enable libvirtd
|
|
|
|
virtualisation.libvirtd = {
|
|
|
|
enable = true;
|
|
|
|
onBoot = "ignore";
|
|
|
|
onShutdown = "shutdown";
|
|
|
|
qemu = {
|
|
|
|
ovmf = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.OVMFFull;
|
|
|
|
};
|
2022-10-10 23:03:38 -04:00
|
|
|
runAsRoot = true;
|
2022-10-09 21:43:38 -04:00
|
|
|
swtpm.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
})
|
|
|
|
];
|
2022-06-23 02:57:41 -04:00
|
|
|
}
|