nichts/hosts/temperance/kernel/xanmod.nix

76 lines
1.9 KiB
Nix
Raw Normal View History

2024-10-22 23:50:10 +02:00
{
lib,
fetchFromGitHub,
buildLinux,
2024-10-23 00:07:16 +02:00
kernelPatches,
2024-10-22 23:50:10 +02:00
...
}: let
2024-10-23 00:07:16 +02:00
pname = "linux-xanmod";
2024-10-23 00:45:35 +02:00
version = "6.11.5";
2024-10-23 00:07:16 +02:00
vendorSuffix = "xanmod1";
2024-11-08 12:47:32 +01:00
modDirVersion = lib.versions.pad 3 "${version}-blox";
2024-10-22 23:50:10 +02:00
2024-11-08 12:47:32 +01:00
inherit (lib.modules) mkForce mkOverride;
2024-10-23 00:45:35 +02:00
inherit (lib.kernel) freeform yes no;
2024-11-08 12:47:32 +01:00
xanmod_blox =
(buildLinux {
inherit pname version modDirVersion;
2024-10-22 23:50:10 +02:00
2024-11-08 12:47:32 +01:00
src = fetchFromGitHub {
owner = "xanmod";
repo = "linux";
rev = "refs/tags/${version}-${vendorSuffix}";
hash = "sha256-G4u0LQtIeJ0dNAmjNH0OKihmbkivYVbrbXDB9vPw2xI=";
};
2024-10-23 00:07:16 +02:00
2024-11-08 12:47:32 +01:00
kernelPatches = [
kernelPatches.bridge_stp_helper
kernelPatches.request_key_helper
];
2024-10-22 23:50:10 +02:00
2024-11-08 12:47:32 +01:00
enableCommonConfig = true;
# Default Xanmod options
structuredExtraConfig = {
# CPUFreq governor Performance
CPU_FREQ_DEFAULT_GOV_PERFORMANCE = mkOverride 60 yes;
CPU_FREQ_DEFAULT_GOV_SCHEDUTIL = mkOverride 60 no;
2024-10-22 23:50:10 +02:00
2024-11-08 12:47:32 +01:00
# Full preemption
PREEMPT = mkOverride 60 yes;
PREEMPT_VOLUNTARY = mkOverride 60 no;
2024-10-22 23:50:10 +02:00
2024-11-08 12:47:32 +01:00
# Google's BBRv3 TCP congestion Control
TCP_CONG_BBR = yes;
DEFAULT_BBR = yes;
2024-10-22 23:50:10 +02:00
2024-11-08 12:47:32 +01:00
# Preemptive Full Tickless Kernel at 250Hz
HZ = freeform "250";
HZ_250 = yes;
HZ_1000 = no;
2024-10-22 23:50:10 +02:00
2024-11-08 12:47:32 +01:00
# RCU_BOOST and RCU_EXP_KTHREAD
RCU_EXPERT = yes;
RCU_FANOUT = freeform "64";
RCU_FANOUT_LEAF = freeform "16";
RCU_BOOST = yes;
RCU_BOOST_DELAY = freeform "0";
RCU_EXP_KTHREAD = yes;
};
})
# 1:1 taken from raf's custom kernel, check out his config for this.
.overrideAttrs (oa: {
prePatch =
(oa.prePatch or "")
+ ''
# bragging rights
echo "Replacing localversion with custom suffix"
substituteInPlace localversion \
--replace-fail "xanmod1" "blox"
'';
});
2024-10-23 00:07:16 +02:00
in {
inherit
xanmod_blox
;
}