virtualisation: Enable libvirt on ptw.virtualisation.enable
This commit is contained in:
parent
d3eb9e25c3
commit
8247e06b1f
@ -10,5 +10,27 @@ in {
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [ virglrenderer unstable.qemu ];
|
environment.systemPackages = with pkgs; [ virglrenderer unstable.qemu ];
|
||||||
services.spice-vdagentd.enable = true;
|
services.spice-vdagentd.enable = true;
|
||||||
|
|
||||||
|
virtualisation.libvirtd = {
|
||||||
|
enable = true;
|
||||||
|
qemu = {
|
||||||
|
package = pkgs.unstable.qemu;
|
||||||
|
ovmf.enable = true;
|
||||||
|
verbatimConfig = ''
|
||||||
|
seccomp_sandbox = 0
|
||||||
|
cgroup_device_acl = [
|
||||||
|
"/dev/null", "/dev/full", "/dev/zero",
|
||||||
|
"/dev/random", "/dev/urandom",
|
||||||
|
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
|
||||||
|
"/dev/rtc","/dev/hpet",
|
||||||
|
"/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse",
|
||||||
|
"/dev/input/by-id/usb-Razer_Razer_Tartarus_V2-event-kbd",
|
||||||
|
"/dev/input/by-id/virtual-event-EvdevProxyMouse",
|
||||||
|
"/dev/input/by-id/virtual-event-EvdevProxyTartarus",
|
||||||
|
"/dev/input/by-id/usb-Razer_Razer_BlackWidow_Ultimate-event-kbd"
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -74,27 +74,6 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation.libvirtd = {
|
|
||||||
enable = true;
|
|
||||||
#qemuRunAsRoot = false;
|
|
||||||
qemuOvmf = true;
|
|
||||||
qemuPackage = pkgs.unstable.qemu;
|
|
||||||
qemuVerbatimConfig = ''
|
|
||||||
seccomp_sandbox = 0
|
|
||||||
cgroup_device_acl = [
|
|
||||||
"/dev/null", "/dev/full", "/dev/zero",
|
|
||||||
"/dev/random", "/dev/urandom",
|
|
||||||
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
|
|
||||||
"/dev/rtc","/dev/hpet",
|
|
||||||
"/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse",
|
|
||||||
"/dev/input/by-id/usb-Razer_Razer_Tartarus_V2-event-kbd",
|
|
||||||
"/dev/input/by-id/virtual-event-EvdevProxyMouse",
|
|
||||||
"/dev/input/by-id/virtual-event-EvdevProxyTartarus",
|
|
||||||
"/dev/input/by-id/usb-Razer_Razer_BlackWidow_Ultimate-event-kbd"
|
|
||||||
]
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# NOTE: Workaround for libvirt's SYSCONFDIR being set to /var/lib
|
# NOTE: Workaround for libvirt's SYSCONFDIR being set to /var/lib
|
||||||
# (See https://github.com/NixOS/nixpkgs/issues/51152#issuecomment-899374407)
|
# (See https://github.com/NixOS/nixpkgs/issues/51152#issuecomment-899374407)
|
||||||
system.activationScripts.libvirt-hooks.text = ''
|
system.activationScripts.libvirt-hooks.text = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user