2024-04-22 15:33:31 +02:00
|
|
|
{ config, pkgs, lib, materusArg, ... }:
|
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"
|
|
|
|
|
|
|
|
|
|
|
|
];
|
2024-05-20 15:40:24 +02:00
|
|
|
|
2023-10-27 12:30:38 +02:00
|
|
|
in
|
2023-10-08 11:42:08 +02:00
|
|
|
{
|
|
|
|
#Kernel
|
2024-05-20 15:40:24 +02:00
|
|
|
|
2024-08-05 00:27:55 +02:00
|
|
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_zen;
|
2024-05-20 15:40:24 +02:00
|
|
|
|
2024-05-10 18:12:05 +02:00
|
|
|
boot.kernelParams = [
|
|
|
|
"rcu_nocbs=${materusArg.materusPC.vmCores}"
|
|
|
|
"nohz_full=${materusArg.materusPC.vmCores}"
|
|
|
|
"vfio_iommu_type1.allow_unsafe_interrupts=1"
|
|
|
|
"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"
|
|
|
|
"amdgpu.ppfeaturemask=0xffffffff"
|
|
|
|
"iommu=pt"
|
2024-08-05 00:27:55 +02:00
|
|
|
"psi=1"
|
2024-05-10 18:12:05 +02:00
|
|
|
] ++ video;
|
2024-04-22 15:33:31 +02:00
|
|
|
boot.kernelModules = [ "pci-stub" "amdgpu" "i2c_dev" "kvm_amd" "vfio" "vfio_iommu_type1" "vfio-pci" ];
|
2023-10-08 11:42:08 +02:00
|
|
|
boot.extraModprobeConfig = ''
|
2023-12-22 11:53:49 +01:00
|
|
|
options kvm_amd nested=1 avic=1 npt=1 sev=0
|
2023-10-27 12:30:38 +02:00
|
|
|
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;
|
2024-10-27 22:00:57 +01:00
|
|
|
"net.ipv4.ip_forward"=1;
|
2023-10-27 12:30:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-10-08 11:42:08 +02:00
|
|
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
2024-04-06 18:51:08 +02:00
|
|
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
2023-10-27 12:30:38 +02:00
|
|
|
|
2024-04-06 18:51:08 +02:00
|
|
|
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
2023-10-08 11:42:08 +02:00
|
|
|
|
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
|
|
|
|
2024-04-06 18:51:08 +02:00
|
|
|
boot.plymouth.enable = true;
|
|
|
|
|
2023-10-27 12:30:38 +02:00
|
|
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
2023-10-08 11:42:08 +02:00
|
|
|
}
|