1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| { config, lib, pkgs, ... }:
{
# <https://github.com/kholia/OSX-KVM>
# Required by AMD boxes for OSX-KVM
boot.extraModprobeConfig = ''
options kvm_amd nested=1
options bt_coex_active=0 swcrypto=1 11n_disable=8
options kvm ignore_msrs=1 report_ignored_msrs=0
'';
# For Intel:
/*
options kvm_intel nested=1
options kvm_intel emulate_invalid_guest_state=0
options kvm ignore_msrs=1
*/
virtualisation.libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
runAsRoot = true;
swtpm.enable = true;
ovmf = {
enable = true;
#packages = [(pkgs.unstable.OVMF.override {
packages = [(pkgs.OVMF.override {
secureBoot = true;
tpmSupport = true;
}).fd];
};
};
};
environment.systemPackages = with pkgs; [
virt-manager
];
}
|