From 8247e06b1fd11bcead697bc37c941aa11028081f Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Tue, 9 Nov 2021 20:17:07 +0100 Subject: [PATCH] virtualisation: Enable libvirt on ptw.virtualisation.enable --- modules/virtualisation/default.nix | 22 ++++++++++++++++++++++ modules/virtualisation/gaming.nix | 21 --------------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/modules/virtualisation/default.nix b/modules/virtualisation/default.nix index 02c12a6..d3e2b71 100644 --- a/modules/virtualisation/default.nix +++ b/modules/virtualisation/default.nix @@ -10,5 +10,27 @@ in { config = lib.mkIf cfg.enable { environment.systemPackages = with pkgs; [ virglrenderer unstable.qemu ]; 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" + ] + ''; + }; + }; }; } diff --git a/modules/virtualisation/gaming.nix b/modules/virtualisation/gaming.nix index 2fe227c..491206e 100644 --- a/modules/virtualisation/gaming.nix +++ b/modules/virtualisation/gaming.nix @@ -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 # (See https://github.com/NixOS/nixpkgs/issues/51152#issuecomment-899374407) system.activationScripts.libvirt-hooks.text = ''