Compare commits
No commits in common. "9ec7fb3c67052d0cf68e95b9f0741225c7ae4083" and "34f8e2640ff17b9377abbffbf6afc6bca3694cf4" have entirely different histories.
9ec7fb3c67
...
34f8e2640f
4 changed files with 32 additions and 37 deletions
|
@ -6,6 +6,5 @@ wallpaper = DP-1,~/.config/wallpapers/current_wallpaper.png
|
|||
wallpaper = DP-2,~/.config/wallpapers/current_wallpaper.png
|
||||
wallpaper = DP-3,~/.config/wallpapers/current_wallpaper.png
|
||||
wallpaper = DP-4,~/.config/wallpapers/current_wallpaper.png
|
||||
wallpaper = HDMI-A-1,~/.config/wallpapers/current_wallpaper.png
|
||||
splash=false
|
||||
ipc = off
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
outputs = inputs@{
|
||||
nixpkgs,
|
||||
nixpkgs-xr,
|
||||
nixos-hardware,
|
||||
home-manager,
|
||||
osu-nixos,
|
||||
|
@ -20,7 +19,6 @@
|
|||
./packages/default.nix
|
||||
./hosts/malachite/default.nix
|
||||
./users/stitchynyan/default.nix
|
||||
nixpkgs-xr.nixosModules.nixpkgs-xr
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
|
@ -83,7 +81,6 @@
|
|||
flake = false;
|
||||
};
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs-xr.url = "github:nix-community/nixpkgs-xr";
|
||||
nixos-hardware.url = "github:Nixos/nixos-hardware/master";
|
||||
osu-nixos.url = "github:Asqiir/osu-nixos";
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, nixpkgs-xr, pkgs, lib, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
passthrough = pkgs.writeShellApplication {
|
||||
name = "passthrough.sh";
|
||||
|
@ -24,42 +24,43 @@ let
|
|||
echo 0 > /sys/class/vtconsole/vtcon1/bind
|
||||
|
||||
# Unbind EFI-Framebuffer
|
||||
#echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
|
||||
|
||||
# Unbind the GPU from display driver
|
||||
virsh nodedev-detach pci_0000_03_00_0
|
||||
virsh nodedev-detach pci_0000_03_00_1
|
||||
virsh nodedev-detach pci_0000_03_00_2
|
||||
|
||||
# Unload Modules
|
||||
modprobe -r amdgpu
|
||||
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
|
||||
|
||||
# We love race conditions
|
||||
sleep 2
|
||||
|
||||
# Unload Modules
|
||||
modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia
|
||||
|
||||
# Unbind the GPU from display driver
|
||||
virsh nodedev-detach pci_0000_01_00_0
|
||||
virsh nodedev-detach pci_0000_01_00_1
|
||||
|
||||
# Load VFIO Kernel Module
|
||||
modprobe vfio vfio_pci vfio_iommu_type1
|
||||
|
||||
elif [[ "$HOOK_NAME/$STATE_NAME" == "release/end" ]]; then
|
||||
|
||||
modprobe -r vfio_iommu_type1 vfio_pci vfio
|
||||
|
||||
# Re-Bind GPU to Host
|
||||
virsh nodedev-reattach pci_0000_03_00_0
|
||||
virsh nodedev-reattach pci_0000_03_00_1
|
||||
virsh nodedev-reattach pci_0000_03_00_2
|
||||
|
||||
# Rebind VT consoles
|
||||
echo 1 > /sys/class/vtconsole/vtcon0/bind
|
||||
echo 1 > /sys/class/vtconsole/vtcon1/bind
|
||||
modprobe vfio_pci
|
||||
|
||||
sleep 2
|
||||
|
||||
# Bind Framebuffer
|
||||
#echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
|
||||
elif [[ "$HOOK_NAME/$STATE_NAME" == "release/end" ]]; then
|
||||
|
||||
# Reload Modules
|
||||
modprobe amdgpu
|
||||
# Re-Bind GPU to Nvidia Driver (replace the pci addresses with yours)
|
||||
virsh nodedev-reattach pci_0000_01_00_0
|
||||
virsh nodedev-reattach pci_0000_01_00_1
|
||||
|
||||
modprobe -r vfio-pci
|
||||
|
||||
#bind efi
|
||||
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
|
||||
|
||||
# Reload nvidia modules
|
||||
modprobe nvidia_drm
|
||||
modprobe nvidia_modeset
|
||||
modprobe nvidia_uvm
|
||||
modprobe nvidia
|
||||
|
||||
# Rebind VT consoles
|
||||
echo 1 > /sys/class/vtconsole/vtcon0/bind
|
||||
bin/echo 1 > /sys/class/vtconsole/vtcon1/bind
|
||||
|
||||
fi
|
||||
|
||||
|
@ -98,9 +99,6 @@ in {
|
|||
databaseDir = "/home/stitchynyan/.local/share/syncthing";
|
||||
dataDir = "/home/stitchynyan";
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.wlx-overlay-s ];
|
||||
|
||||
networking.hostName = "malachite";
|
||||
|
||||
|
|
|
@ -88,9 +88,10 @@
|
|||
};
|
||||
|
||||
hardware = {
|
||||
graphics = {
|
||||
opengl = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue