2021-11-01 20:33:21 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2021-09-02 19:06:09 +00:00
|
|
|
|
2021-11-01 20:33:21 +00:00
|
|
|
let
|
|
|
|
cfg = config.ptw.virtualisation;
|
|
|
|
in {
|
|
|
|
options.ptw.virtualisation = {
|
|
|
|
enable = lib.mkEnableOption "Enable and configure virtualisation";
|
|
|
|
};
|
2021-09-02 19:06:09 +00:00
|
|
|
|
2021-11-01 20:33:21 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2021-11-04 18:56:27 +00:00
|
|
|
environment.systemPackages = with pkgs; [ virglrenderer unstable.qemu ];
|
2021-11-01 20:33:21 +00:00
|
|
|
services.spice-vdagentd.enable = true;
|
2021-11-09 19:17:07 +00:00
|
|
|
|
|
|
|
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",
|
2022-02-02 11:08:03 +00:00
|
|
|
"/dev/input/by-id/usb-Logitech_G700s_Rechargeable_Gaming_Mouse_93DF48160007-event-mouse",
|
2021-11-09 19:17:07 +00:00
|
|
|
"/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"
|
|
|
|
]
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2021-11-01 20:33:21 +00:00
|
|
|
};
|
2021-09-02 19:06:09 +00:00
|
|
|
}
|