Update USB mouse configuration for chocoaltebar VM guests

This commit is contained in:
Benjamin Bädorf 2023-01-02 20:29:01 +01:00
parent 992fc5ad9a
commit 4d28cb191d
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C
2 changed files with 3 additions and 2 deletions

View file

@ -24,6 +24,7 @@ in
services.openssh.openFirewall = true; services.openssh.openFirewall = true;
networking.firewall.allowedTCPPorts = [ 443 ] ++ (if psCfg.sway.vnc.enable then [ 5901 ] else [ ]); networking.firewall.allowedTCPPorts = [ 443 ] ++ (if psCfg.sway.vnc.enable then [ 5901 ] else [ ]);
networking.firewall.allowedUDPPorts = [ 43050 ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wayvnc wayvnc

View file

@ -53,8 +53,8 @@ in
${if vm.handOverUSBDevices then '' ${if vm.handOverUSBDevices then ''
# Hand over mouse # Hand over mouse
USB_BUS=5 USB_BUS=3
USB_DEV=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c52b | grep 'Bus 005' | cut -b 18) 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) LINE_NUMBER=$(cat $TMP_FILE | grep -n -A 1 0xc52b | tail -n 1 | cut -b 1,2,3)
sed -i "''${LINE_NUMBER}s/.*/<address bus=\"''${USB_BUS}\" device=\"''${USB_DEV}\" \/>/" "$TMP_FILE" sed -i "''${LINE_NUMBER}s/.*/<address bus=\"''${USB_BUS}\" device=\"''${USB_DEV}\" \/>/" "$TMP_FILE"