vifo config
This commit is contained in:
parent
8f2ecff5d1
commit
7c1e567f48
|
@ -6,6 +6,7 @@ let
|
||||||
inherit system;
|
inherit system;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
imports = [ ./passthrough.nix ];
|
||||||
# Sops setup for this machine
|
# Sops setup for this machine
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
"borg-ssh-key" = {
|
"borg-ssh-key" = {
|
||||||
|
@ -79,8 +80,6 @@ in {
|
||||||
allowedUDPPorts = [ 61377 1701 9001 ];
|
allowedUDPPorts = [ 61377 1701 9001 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# GPU passthrough
|
|
||||||
boot.kernelParams = [ "amd_iommu=on" ];
|
|
||||||
|
|
||||||
# Setup home manager
|
# Setup home manager
|
||||||
home-manager.users.nathan = import ./home.nix;
|
home-manager.users.nathan = import ./home.nix;
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
gpuIDs = [
|
||||||
|
# 2080 super
|
||||||
|
"10de:1e81" # Graphics
|
||||||
|
"10de:10f8" # Audio
|
||||||
|
"10de:1ad8" # Usb ????
|
||||||
|
"10de:1ad9" # Usb ????
|
||||||
|
];
|
||||||
|
in {
|
||||||
|
boot = {
|
||||||
|
kernelParams = [
|
||||||
|
# enable iommu
|
||||||
|
"amd_iommu=on"
|
||||||
|
# Isolate the nvidia gpu
|
||||||
|
("vfio-pci.ids=" + lib.concatStringsSep "," gpuIDs)
|
||||||
|
];
|
||||||
|
# Modules needed
|
||||||
|
initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [ looking-glass-client ];
|
||||||
|
virtualisation.spiceUSBRedirection.enable = true;
|
||||||
|
virtualisation.libvirtd = {
|
||||||
|
qemu = {
|
||||||
|
swtpm.enable = true;
|
||||||
|
ovmf = {
|
||||||
|
enable = true;
|
||||||
|
packages = [ pkgs.OVMFFull.fd ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.tmpfiles.rules =
|
||||||
|
[ "f /dev/shm/looking-glass 0660 nathan qemu-libvirtd -" ];
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ in with lib; {
|
||||||
# Enable the kernel modules
|
# Enable the kernel modules
|
||||||
boot.kernelModules = [ "kvm-amd" "kvm-intel" ];
|
boot.kernelModules = [ "kvm-amd" "kvm-intel" ];
|
||||||
# Enable libvirt
|
# Enable libvirt
|
||||||
|
programs.dconf.enable = true;
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
# Install virt-manager
|
# Install virt-manager
|
||||||
environment.systemPackages = with pkgs; [ virtmanager virt-viewer ];
|
environment.systemPackages = with pkgs; [ virtmanager virt-viewer ];
|
||||||
|
|
Loading…
Reference in New Issue