mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
99 lines
3.4 KiB
Nix
99 lines
3.4 KiB
Nix
final: prev: let
|
|
inherit (final) lib;
|
|
in {
|
|
linuxPackages = final.linuxPackagesFor (
|
|
prev.linuxPackages.kernel.override {
|
|
# TODO: The error message is quite unintuitive, maybe improve it?
|
|
# https://github.com/NixOS/nixpkgs/issues/82951
|
|
structuredExtraConfig = with lib.kernel; {
|
|
# optimisation for ryzen 7
|
|
# https://wiki.gentoo.org/wiki/Ryzen
|
|
SMP = yes;
|
|
X86_X2APIC = yes;
|
|
X86_AMD_PLATFORM_DEVICE = yes;
|
|
|
|
# Cherry pick my CPU support
|
|
PROCESSOR_SELECT = yes;
|
|
CPU_SUP_AMD = yes;
|
|
# Disable intel CPU support
|
|
CPU_SUP_INTEL = no;
|
|
INTEL_HFI_THERMAL = lib.mkForce unset;
|
|
INTEL_IDLE = lib.mkForce unset;
|
|
INTEL_TDX_GUEST = lib.mkForce unset;
|
|
POWER_RESET_GPIO = lib.mkForce unset;
|
|
POWER_RESET_GPIO_RESTART = lib.mkForce unset;
|
|
TDX_GUEST_DRIVER = lib.mkForce unset;
|
|
X86_INTEL_TSX_MODE_AUTO = lib.mkForce unset;
|
|
X86_SGX = lib.mkForce unset;
|
|
X86_SGX_KVM = lib.mkForce unset;
|
|
|
|
SCHED_MC = yes;
|
|
X86_MCE = yes;
|
|
X86_MCE_AMD = yes;
|
|
PERF_EVENTS_INTEL_RAPL = yes;
|
|
X86_AMD_PSTATE = yes;
|
|
X86_POWERNOW_K8 = no;
|
|
|
|
# With amd_pstate=active ondemand won't be available anyway.
|
|
# Without more testing, we should accept the claim that its more power efficient and stick to it
|
|
CPU_FREQ = yes;
|
|
X86_INTEL_PSTATE = lib.mkForce no;
|
|
CPU_FREQ_DEFAULT_GOV_SCHEDUTIL = lib.mkForce no;
|
|
CPU_FREQ_DEFAULT_GOV_ONDEMAND = yes;
|
|
# ERROR: could not insert 'amd_freq_sensitivity': No such device
|
|
X86_AMD_FREQ_SENSITIVITY = module;
|
|
|
|
# skipping firmware loading section since it's handled by other parts of nixos options
|
|
SENSORS_K10TEMP = yes;
|
|
IOMMU_SUPPORT = yes;
|
|
AMD_IOMMU = yes;
|
|
|
|
# additional chipset drivers
|
|
I2C_PIIX4 = yes;
|
|
PINCTRL = yes;
|
|
PINCTRL_AMD = yes;
|
|
CRYPTO = yes;
|
|
CRYPTO_HW = yes;
|
|
CRYPTO_DEV_CCP = yes;
|
|
CRYPTO_DEV_SP_CCP = yes;
|
|
CRYPTO_DEV_CCP_CRYPTO = yes;
|
|
CRYPTO_DEV_CCP_DD = yes;
|
|
CRYPTO_DEV_SP_PSP = yes;
|
|
|
|
# Power management controller
|
|
X86_PLATFORM_DEVICES = yes;
|
|
AMD_PMC = yes;
|
|
|
|
# My config
|
|
DRM_AMDGPU = yes; # Recent AMD GPU
|
|
|
|
# Disable hypervisor guest
|
|
HYPERVISOR_GUEST = lib.mkForce no;
|
|
HYPERV = lib.mkForce unset;
|
|
DRM_HYPERV = lib.mkForce unset;
|
|
FB_HYPERV = lib.mkForce unset;
|
|
HVC_XEN = lib.mkForce unset;
|
|
HVC_XEN_FRONTEND = lib.mkForce unset;
|
|
KVM_GUEST = lib.mkForce unset;
|
|
MOUSE_PS2_VMMOUSE = lib.mkForce unset;
|
|
PARAVIRT = lib.mkForce unset;
|
|
PARAVIRT_SPINLOCKS = lib.mkForce unset;
|
|
PARAVIRT_TIME_ACCOUNTING = lib.mkForce unset;
|
|
PCI_XEN = lib.mkForce unset;
|
|
SWIOTLB_XEN = lib.mkForce unset;
|
|
XEN = lib.mkForce unset;
|
|
XEN_BACKEND = lib.mkForce unset;
|
|
XEN_BALLOON = lib.mkForce unset;
|
|
XEN_BALLOON_MEMORY_HOTPLUG = lib.mkForce unset;
|
|
XEN_DOM0 = lib.mkForce unset;
|
|
XEN_EFI = lib.mkForce unset;
|
|
XEN_HAVE_PVMMU = lib.mkForce unset;
|
|
XEN_MCE_LOG = lib.mkForce unset;
|
|
XEN_PVH = lib.mkForce unset;
|
|
XEN_PVHVM = lib.mkForce unset;
|
|
XEN_SAVE_RESTORE = lib.mkForce unset;
|
|
XEN_SYS_HYPERVISOR = lib.mkForce unset;
|
|
};
|
|
}
|
|
);
|
|
}
|