nixos-config/configurations/host/materusPC/hardware/boot.nix

58 lines
1.7 KiB
Nix
Raw Normal View History

2023-10-08 11:42:08 +02:00
{ config, pkgs, lib, inputs, materusFlake, ... }:
2023-10-27 12:30:38 +02:00
let
video = [
"video=HDMI-A-3:1920x1080@144"
"video=DP-3:1920x1080@240"
#"video=DP-1:1920x1080@240"
#"video=DP-2:1920x1080@240"
#"video=HDMI-A-1:1920x1080@240"
#"video=HDMI-A-2:1920x1080@240"
];
in
2023-10-08 11:42:08 +02:00
{
#Kernel
boot.kernelPackages = pkgs.linuxPackages_zen;
2023-10-27 12:30:38 +02:00
boot.kernelParams = [ "pcie_acs_override=downstream,multifunction" /*"pci-stub.ids=1002:744c"*/ "nox2apic" "nvme_core.default_ps_max_latency_us=0" "nvme_core.io_timeout=255" "nvme_core.max_retries=10" "nvme_core.shutdown_timeout=10" "amd_iommu=on" "iommu=pt" ] ++ video;
2023-10-08 11:42:08 +02:00
boot.kernelModules = [ "pci-stub" "amdgpu" "i2c_dev" "kvm_amd" "vfio" "vfio_iommu_type1" "vfio-pci" "v4l2loopback" ];
boot.extraModprobeConfig = ''
2023-10-27 12:30:38 +02:00
options kvm_amd nested=1 avic=1 npt=1
options vfio_iommu_type1 allow_unsafe_interrupts=1
2023-10-08 11:42:08 +02:00
'';
boot.kernel.sysctl = {
2023-10-27 12:30:38 +02:00
"vm.max_map_count" = 1000000;
"vm.swappiness" = 10;
};
2023-10-08 11:42:08 +02:00
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
2023-10-27 12:30:38 +02:00
2023-10-08 11:42:08 +02:00
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
2023-10-27 12:30:38 +02:00
boot.supportedFilesystems = [ "ntfs" "btrfs" "vfat" "exfat" "ext4" ];
2023-10-08 11:42:08 +02:00
boot.tmp.useTmpfs = true;
#bootloader
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.loader.grub = {
enable = true;
efiSupport = true;
device = "nodev";
gfxmodeEfi = pkgs.lib.mkDefault "1920x1080@240";
gfxmodeBios = pkgs.lib.mkDefault "1920x1080@240";
useOSProber = true;
memtest86.enable = true;
};
2023-10-27 12:30:38 +02:00
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
2023-10-08 11:42:08 +02:00
}