~jb55/citadel

ref: 0cffe2f1a4a83c13892392e8325dff4ab05be317 citadel/nix-config/machines/monad/hardware/default.nix -rw-r--r-- 1.0 KiB
0cffe2f1William Casarin monad: no pci hack for now 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ config, lib, pkgs, ... }:
{

  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" "amdgpu" "vfio-pci" ];
  boot.initrd.preDeviceCommands = ''
     DEVS="0000:27:00.0 0000:27:00.1"
     for DEV in $DEVS; do
       echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override
     done
     modprobe -i vfio-pci
  '';

  boot.kernelParams = [ "amdgpu.gpu_recovery=1" "amd_iommu=on" "pcie_aspm=off" ];
  boot.kernelModules = [ "kvm-amd" "kvm-intel" ];
  boot.loader.grub.copyKernels = true;
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "znix/root/nixos";
      fsType = "zfs";
    };

  fileSystems."/home" =
    { device = "znix/home";
      fsType = "zfs";
    };

  fileSystems."/zbig" =
    { device = "zbig";
      fsType = "zfs";
    };

  # swapDevices =
  #   [ { device = "/dev/disk/by-uuid/d4e4ae51-9179-439d-925b-8df42dd1bfc5"; }
  #   ];

  hardware.enableAllFirmware = true;

  boot.loader.grub.devices = [ "/dev/nvme0n1" ];
  boot.supportedFilesystems = ["zfs"];
}