make it run
This commit is contained in:
		
							parent
							
								
									9324add63e
								
							
						
					
					
						commit
						9721eac506
					
				
					 1 changed files with 8 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
{ config, pkgs, ... }
 | 
			
		||||
{ config, pkgs, ... }:
 | 
			
		||||
let
 | 
			
		||||
  passthrough = pkgs.writeShellScript "pasthrough.sh" ''
 | 
			
		||||
    #/usr/bin/env bash
 | 
			
		||||
  passthrough = pkgs.writeShellScript "passthrough.sh" ''
 | 
			
		||||
    #!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
    GUEST_NAME="$1"
 | 
			
		||||
    HOOK_NAME="$2"
 | 
			
		||||
| 
						 | 
				
			
			@ -11,10 +11,10 @@ let
 | 
			
		|||
    set -x
 | 
			
		||||
    
 | 
			
		||||
    # For the windows 10 VM
 | 
			
		||||
    if[$GUEST_NAME == 'win10']; then
 | 
			
		||||
    if [[ "$GUEST_NAME" == "win10" ]]; then
 | 
			
		||||
 | 
			
		||||
      # Prepare hook
 | 
			
		||||
      if["$HOOK_NAME/$STATE_NAME" == "prepare/begin"]; then
 | 
			
		||||
      if [[ "$HOOK_NAME/$STATE_NAME" == "prepare/begin" ]]; then
 | 
			
		||||
 | 
			
		||||
        # Remove Hyprland
 | 
			
		||||
        pkill Hyprland
 | 
			
		||||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ let
 | 
			
		|||
        # Load VFIO Kernel Module 
 | 
			
		||||
        modprobe vfio_pci
 | 
			
		||||
 | 
			
		||||
      elif["$HOOK_NAME/$STATE_NAME" == "release/end"]; then
 | 
			
		||||
      elif [[ "$HOOK_NAME/$STATE_NAME" == "release/end" ]]; then
 | 
			
		||||
 | 
			
		||||
        # Re-Bind GPU to Nvidia Driver (replace the pci addresses with yours)
 | 
			
		||||
        virsh nodedev-reattach pci_0000_01_00_0
 | 
			
		||||
| 
						 | 
				
			
			@ -67,7 +67,7 @@ in {
 | 
			
		|||
    [
 | 
			
		||||
      ./hardware-configuration.nix
 | 
			
		||||
    ];
 | 
			
		||||
    virtualization.libvirtd.hooks.qemu = {
 | 
			
		||||
    virtualisation.libvirtd.hooks.qemu = {
 | 
			
		||||
      passthrough = "${passthrough}";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -80,4 +80,4 @@ in {
 | 
			
		|||
  # Read the Docs before Changing
 | 
			
		||||
  system.stateVersion = "23.05"; # Did you read the comment?
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue