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