Move variables to more convenient folder
This commit is contained in:
parent
87a53e364f
commit
9c03712908
30 changed files with 159 additions and 45 deletions
33
hosts/extern/boot/default.nix
vendored
33
hosts/extern/boot/default.nix
vendored
|
@ -1,7 +1,36 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
let
|
||||
commonKernelParams = [
|
||||
# VM/GPU passthrough
|
||||
"amd_iommu=on"
|
||||
"iommu=pt"
|
||||
"nested=1"
|
||||
|
||||
# Virtualization nonsense
|
||||
"transparent_hugepage=never"
|
||||
|
||||
# Isolate devices into IOMMU groups
|
||||
"pcie_acs_override=downstream,multifunction"
|
||||
"pci=routeirq"
|
||||
];
|
||||
in {
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
# Must be Zen for IOMMU isolation
|
||||
kernelPackages = pkgs.unstable.linuxPackages_zen;
|
||||
kernel.sysctl."vm.max_map_count" = 2147483642;
|
||||
kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:1f82,10de:10fa" ];
|
||||
blacklistedKernelModules = [ "pcspkr" ];
|
||||
|
||||
# Needed for GPU passthrough
|
||||
initrd.kernelModules = [
|
||||
"vfio"
|
||||
"vfio_pci"
|
||||
"vfio_iommu_type1"
|
||||
];
|
||||
};
|
||||
|
||||
# Use second GPU on boot
|
||||
specialisation.gputwo.configuration = {
|
||||
boot.kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:2504,10de:228e" ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue