vanadium: kernel customization

This commit is contained in:
Primrose 2025-09-11 08:03:50 +08:00
parent 5e96b3d6aa
commit 9ced079f55
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 58 additions and 0 deletions

View file

@ -58,6 +58,7 @@ in
../packages/overlay.nix
./vanadium/overlay.nix
./vanadium/kernel-overlay.nix
# removed, but I need it for PLFA!
../overlays/pin-emacs28.nix

View file

@ -0,0 +1,57 @@
final: prev: let
inherit (final) lib;
in {
linuxPackages = final.linuxPackagesFor (
prev.linuxPackages.kernel.override {
ignoreConfigErrors = true;
structuredExtraConfig = with lib.kernel; {
# optimisation for ryzen 7
# https://wiki.gentoo.org/wiki/Ryzen
SMP = yes;
X86_X2APIC = yes;
X86_AMD_PLATFORM_DEVICE = yes;
PROCESSOR_SELECT = yes;
CPU_SUP_AMD = yes;
SCHED_MC = yes;
X86_MCE = yes;
X86_MCE_AMD = yes;
PERF_EVENTS_INTEL_RAPL = yes;
# # unused option
# CPU_FREQ_DEFAULT_GOV_ONDEMAND = yes;
# # no such option
# MICROCODE_AMD = yes;
# # <5.17
# X86_ACPI_CPUFREQ = yes;
X86_AMD_PSTATE = yes;
X86_POWERNOW_K8 = no;
# # FIXME: crashes the build, seems to answer the question twice
# X86_AMD_FREQ_SENSITIVITY = yes;
# skipping firmware loading since it's handled by other parts of nix
SENSORS_K10TEMP = yes;
IOMMU_SUPPORT = yes;
AMD_IOMMU = yes;
# # no such option
# AMD_IOMMU_2 = 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
};
}
);
}