b12f restructure #1
|
@ -48,12 +48,12 @@ in
|
||||||
sed -i "s/UUID/''${UUID}/" "$TMP_FILE"
|
sed -i "s/UUID/''${UUID}/" "$TMP_FILE"
|
||||||
|
|
||||||
${if vm.handOverUSBDevices then ''
|
${if vm.handOverUSBDevices then ''
|
||||||
# Hand over keyboard
|
# Hand over mouse
|
||||||
USB_DEV=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c52b | grep 'Bus 001' | cut -b 18)
|
USB_DEV=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c52b | grep 'Bus 001' | 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/\(.\{33\}\)./\1''${USB_DEV}/" "$TMP_FILE"
|
sed -i "''${LINE_NUMBER}s/\(.\{33\}\)./\1''${USB_DEV}/" "$TMP_FILE"
|
||||||
|
|
||||||
# Hand over mouse
|
# Hand over keyboard
|
||||||
USB_BUS=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c328 | cut -b 7)
|
USB_BUS=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c328 | cut -b 7)
|
||||||
USB_DEV=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c328 | cut -b 18)
|
USB_DEV=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c328 | cut -b 18)
|
||||||
LINE_NUMBER=$(cat $TMP_FILE | grep -n -A 1 0xc328 | tail -n 1 | cut -b 1,2,3)
|
LINE_NUMBER=$(cat $TMP_FILE | grep -n -A 1 0xc328 | tail -n 1 | cut -b 1,2,3)
|
||||||
|
|
|
@ -6,7 +6,7 @@ let
|
||||||
createService = import ./create-service.nix;
|
createService = import ./create-service.nix;
|
||||||
|
|
||||||
isolateGPU = "rx550x";
|
isolateGPU = "rx550x";
|
||||||
handOverUSBDevices = false;
|
handOverUSBDevices = true;
|
||||||
|
|
||||||
isolateAnyGPU = isolateGPU != null;
|
isolateAnyGPU = isolateGPU != null;
|
||||||
in
|
in
|
||||||
|
|
|
@ -198,7 +198,7 @@ in
|
||||||
<source>
|
<source>
|
||||||
<vendor id='0x046d'/>
|
<vendor id='0x046d'/>
|
||||||
<product id='0xc52b'/>
|
<product id='0xc52b'/>
|
||||||
<address bus='1' device='4'/>
|
<address bus='1' device='3'/>
|
||||||
</source>
|
</source>
|
||||||
<address type='usb' bus='0' port='5'/>
|
<address type='usb' bus='0' port='5'/>
|
||||||
</hostdev>
|
</hostdev>
|
||||||
|
|
|
@ -19,7 +19,7 @@ in
|
||||||
|
|
||||||
virtualisation.libvirtd = {
|
virtualisation.libvirtd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
qemuOvmf = true;
|
qemu.ovmf.enable = true;
|
||||||
};
|
};
|
||||||
users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] {
|
users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] {
|
||||||
extraGroups = [ "libvirtd" ];
|
extraGroups = [ "libvirtd" ];
|
||||||
|
|
Loading…
Reference in a new issue