From 4d28cb191d500fe082e8bee7a368b2a713a12f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 2 Jan 2023 20:29:01 +0100 Subject: [PATCH] Update USB mouse configuration for chocoaltebar VM guests --- hosts/chocolatebar/chocolatebar.nix | 1 + hosts/chocolatebar/virtualisation/create-service.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hosts/chocolatebar/chocolatebar.nix b/hosts/chocolatebar/chocolatebar.nix index 28be767..eefabdc 100644 --- a/hosts/chocolatebar/chocolatebar.nix +++ b/hosts/chocolatebar/chocolatebar.nix @@ -24,6 +24,7 @@ in services.openssh.openFirewall = true; networking.firewall.allowedTCPPorts = [ 443 ] ++ (if psCfg.sway.vnc.enable then [ 5901 ] else [ ]); + networking.firewall.allowedUDPPorts = [ 43050 ]; environment.systemPackages = with pkgs; [ wayvnc diff --git a/hosts/chocolatebar/virtualisation/create-service.nix b/hosts/chocolatebar/virtualisation/create-service.nix index b88c089..8229c46 100644 --- a/hosts/chocolatebar/virtualisation/create-service.nix +++ b/hosts/chocolatebar/virtualisation/create-service.nix @@ -53,8 +53,8 @@ in ${if vm.handOverUSBDevices then '' # Hand over mouse - USB_BUS=5 - USB_DEV=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c52b | grep 'Bus 005' | cut -b 18) + USB_BUS=3 + USB_DEV=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c52b | grep "Bus 00''${USB_BUS}" | cut -b 18) LINE_NUMBER=$(cat $TMP_FILE | grep -n -A 1 0xc52b | tail -n 1 | cut -b 1,2,3) sed -i "''${LINE_NUMBER}s/.*/
/" "$TMP_FILE"