miku: Update

This commit is contained in:
2023-04-08 17:30:39 +02:00
parent b716c8a288
commit 30bb872ed9
11 changed files with 98 additions and 89 deletions

View File

@@ -36,39 +36,39 @@ in {
[[device.Simple.selector]]
USBIDClass = {vendor=0x1532, model=0x011a, class="Keyboard"}
'';
"libvirt/hooks/qemu".source = let
vfio-isolate-state = "/tmp/vfio-isolate-state";
in pkgs.writeScript "qemu" ''
#!${pkgs.stdenv.shell}
guest=$1
action=$2
phase=$3
extra=$4
# "libvirt/hooks/qemu".source = let
# vfio-isolate-state = "/tmp/vfio-isolate-state";
# in pkgs.writeScript "qemu" ''
# #!${pkgs.stdenv.shell}
# guest=$1
# action=$2
# phase=$3
# extra=$4
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
# 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
GUEST_CORES="C1-3,5-7"
${pkgs.vfio-isolate}/bin/vfio-isolate \
-u ${vfio-isolate-state} \
cpu-governor performance "$GUEST_CORES" \
cpuset-create --cpus "$GUEST_CORES" /guest.slice \
cpuset-create --cpus C0,4 /host.slice \
move-tasks / /host.slice \
irq-affinity mask "$GUEST_CORES"
;;
stopped)
# Only run when the VM is fully stopped
[[ ! "$phase" = "end" ]] && exit 0
${pkgs.vfio-isolate}/bin/vfio-isolate \
restore ${vfio-isolate-state}
esac
fi
'';
# GUEST_CORES="C1-3,5-7"
# ${pkgs.vfio-isolate}/bin/vfio-isolate \
# -u ${vfio-isolate-state} \
# cpu-governor performance "$GUEST_CORES" \
# cpuset-create --cpus "$GUEST_CORES" /guest.slice \
# cpuset-create --cpus C0,4 /host.slice \
# move-tasks / /host.slice \
# irq-affinity mask "$GUEST_CORES"
# ;;
# stopped)
# # Only run when the VM is fully stopped
# [[ ! "$phase" = "end" ]] && exit 0
# ${pkgs.vfio-isolate}/bin/vfio-isolate \
# restore ${vfio-isolate-state}
# esac
# fi
# '';
};
# NOTE: Workaround for libvirt's SYSCONFDIR being set to /var/lib
@@ -81,7 +81,7 @@ in {
systemd = {
services = {
libvirtd.path = with pkgs; [ vfio-isolate systemd bash ];
libvirtd.path = with pkgs; [ /*vfio-isolate*/ systemd bash ];
};
user.services.evdev-proxy = {