Compare commits

..

2 commits

Author SHA1 Message Date
a40307cadf
rebase 2024-03-14 00:31:05 -07:00
9721eac506
make it run 2024-03-14 00:29:36 -07:00

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... } { config, pkgs, ... }:
let let
passthrough = pkgs.writeShellScript "pasthrough.sh" '' passthrough = pkgs.writeShellScript "pasthrough.sh" ''
GUEST_NAME="$1" GUEST_NAME="$1"
@ -9,10 +9,10 @@ let
set -x set -x
# For the windows 10 VM # For the windows 10 VM
if[$GUEST_NAME == 'win10']; then if [[ "$GUEST_NAME" == "win10" ]]; then
# Prepare hook # Prepare hook
if["$HOOK_NAME/$STATE_NAME" == "prepare/begin"]; then if [[ "$HOOK_NAME/$STATE_NAME" == "prepare/begin" ]]; then
# Remove Hyprland # Remove Hyprland
${pkgs.busybox}/bin/pkill Hyprland ${pkgs.busybox}/bin/pkill Hyprland
@ -34,7 +34,7 @@ let
# Load VFIO Kernel Module # Load VFIO Kernel Module
${pkgs.busybox}/bin/modprobe vfio_pci ${pkgs.busybox}/bin/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) # Re-Bind GPU to Nvidia Driver (replace the pci addresses with yours)
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_0 ${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_0
@ -65,7 +65,7 @@ in {
[ [
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
virtualization.libvirtd.hooks.qemu = { virtualisation.libvirtd.hooks.qemu = {
passthrough = "${passthrough}"; passthrough = "${passthrough}";
}; };
@ -78,4 +78,4 @@ in {
# Read the Docs before Changing # Read the Docs before Changing
system.stateVersion = "23.05"; # Did you read the comment? system.stateVersion = "23.05"; # Did you read the comment?
}; }