dotfiles/nixos-modules/virtualisation/default.nix
Fabian Hauser e02d86dffd
All checks were successful
CI / build (push) Successful in 2m9s
Update and clean up modules
2025-03-03 23:46:19 +02:00

32 lines
676 B
Nix

{ config, ... }:
{
virtualisation = {
docker = {
enable = true;
enableOnBoot = false;
};
libvirtd.enable = true;
spiceUSBRedirection.enable = true;
};
boot.extraModprobeConfig =
let
isIntel = config.hardware.cpu.intel.updateMicrocode;
isAmd = config.hardware.cpu.amd.updateMicrocode;
procName =
if isIntel then
"intel"
else if isAmd then
"amd"
else
"";
in
if isIntel || isAmd then
''
options kvm_${procName} nested=1
options kvm_${procName} emulate_invalid_guest_state=0
options kvm ignore_msrs=1
''
else
"";
}