make it run

This commit is contained in:
stitchy 2024-03-14 00:29:36 -07:00
parent 9324add63e
commit 9721eac506
Signed by: stitchy
SSH key fingerprint: SHA256:p+xeQgmOvQ2br1d2STl5OnRRMef2LRqCtGA7SO4WYk0

View file

@ -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?
};
}