nixos-config/hosts/tower/boot/default.nix

28 lines
682 B
Nix

{ config, lib, pkgs, ... }:
let
commonKernelParams = [
"amd_iommu=on"
"iommu=pt"
];
in {
boot = {
kernelPackages = pkgs.linuxPackages_6_14;
kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:1f82,10de:10fa" ];
# Load into GPU before video driver
initrd.kernelModules = [
"vfio"
"vfio_pci"
"vfio_iommu_type1"
];
# Secure boot
lanzaboote.enable = true;
# Emulate different architectures for remote builds
binfmt.emulatedSystems = [ "aarch64-linux" ];
};
# Use second GPU on boot
specialisation.gputwo.configuration.boot.kernelParams = commonKernelParams ++ [ "vfio-pci.ids=10de:2504,10de:228e" ];
}