miku: Do a lot of things

This commit is contained in:
2022-02-14 18:34:04 +01:00
parent 1fa05e9822
commit fb4815a7dd
9 changed files with 45 additions and 46 deletions

View File

@@ -23,12 +23,9 @@ in {
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
"/dev/rtc","/dev/hpet",
"/dev/input/by-id/usb-Logitech_G700s_Rechargeable_Gaming_Mouse_93DF48160007-event-mouse",
"/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"
"/dev/input/by-id/virtual-event-EvdevProxyKeyboard",
"/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse"
]
'';
};

View File

@@ -24,7 +24,7 @@ in {
USBIDClass = {vendor=0x046d, model=0xc07c, class="Mouse"}
[[device]]
[device.Simple]
name = "EvdevProxyTartarus"
name = "EvdevProxyKeyboard"
vendor = 0x1337
model = 0x1338
class = "Keyboard"
@@ -32,7 +32,9 @@ in {
# the mapped version of the Tartarus evdev node.
# (Useful for qemu)
[[device.Simple.selector]]
EVDEVClass = {phys="\"key-mapper\""}
EVDEVClass = {phys="\"input-remapper\""}
[[device.Simple.selector]]
USBIDClass = {vendor=0x1532, model=0x011a, class="Keyboard"}
'';
"libvirt/hooks/qemu".source = let
vfio-isolate-state = "/tmp/vfio-isolate-state";
@@ -43,16 +45,14 @@ in {
phase=$3
extra=$4
if [[ "$guest" = "win10" ]]; then
echo "called with $1 $2 $3 $4" > /dev/stderr
if [[ "$guest" = "win10-gaming" ]]; then
case "$action" in
prepare)
# Only do this while in preparation
[[ ! "$phase" = "prepare" ]] && exit 0
sudo -u alexander systemctl --user start evdev-proxy.service
sudo -u alexander systemctl --user start scream.service
sleep 2
GUEST_CORES="C1-3,5-7"
${pkgs.vfio-isolate}/bin/vfio-isolate \
-u ${vfio-isolate-state} \
cpu-governor performance "$GUEST_CORES" \
@@ -64,9 +64,6 @@ in {
stopped)
# Only run when the VM is fully stopped
[[ ! "$phase" = "end" ]] && exit 0
sudo -u alexander systemctl --user stop evdev-proxy.service
sudo -u alexander systemctl --user stop scream.service
${pkgs.vfio-isolate}/bin/vfio-isolate \
restore ${vfio-isolate-state}
esac
@@ -85,15 +82,6 @@ in {
systemd = {
services = {
libvirtd.path = with pkgs; [ vfio-isolate systemd bash ];
virtiofsd = {
description = "vhost-user virtio-fs device backend written in Rust";
wantedBy = [ "default.target" "libvirtd.service" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.virtiofsd}/bin/virtiofsd --socket-path=/tmp/vfsd.sock --shared-dir /mnt/Storage/Games --announce-submounts --inode-file-handles=mandatory";
Restart = "always";
};
};
};
user.services.evdev-proxy = {