nixos-config/modules/virtualisation/default.nix

35 lines
981 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
let
cfg = config.ptw.virtualisation;
in {
options.ptw.virtualisation = {
enable = lib.mkEnableOption "Enable and configure virtualisation";
};
config = lib.mkIf cfg.enable {
2022-05-05 09:27:43 +00:00
environment.systemPackages = with pkgs; [ virglrenderer unstable.qemu virt-manager ];
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/virtual-event-EvdevProxyMouse",
2022-02-14 17:34:04 +00:00
"/dev/input/by-id/virtual-event-EvdevProxyKeyboard",
"/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse"
]
'';
};
};
};
}