1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 buildLinux,
6 variant,
7 ...
8}@args:
9
10let
11 # These names are how they are designated in https://xanmod.org.
12
13 # NOTE: When updating these, please also take a look at the changes done to
14 # kernel config in the xanmod version commit
15 variants = {
16 lts = {
17 version = "6.12.28";
18 hash = "sha256-afmAC1tdiggI2qN1Kf9fJiUJqC9d8gzTj5PAg7wsiuw=";
19 };
20 main = {
21 version = "6.14.6";
22 hash = "sha256-wI383p+g03RrNUkPdo0TnB1n5yZI7bGwcSjB/9HpQH0=";
23 };
24 };
25
26 xanmodKernelFor =
27 {
28 version,
29 suffix ? "xanmod1",
30 hash,
31 }:
32 buildLinux (
33 args
34 // rec {
35 inherit version;
36 pname = "linux-xanmod";
37 modDirVersion = lib.versions.pad 3 "${version}-${suffix}";
38
39 src = fetchFromGitLab {
40 owner = "xanmod";
41 repo = "linux";
42 rev = modDirVersion;
43 inherit hash;
44 };
45
46 structuredExtraConfig = with lib.kernel; {
47 # CPUFreq governor Performance
48 CPU_FREQ_DEFAULT_GOV_PERFORMANCE = lib.mkOverride 60 yes;
49 CPU_FREQ_DEFAULT_GOV_SCHEDUTIL = lib.mkOverride 60 no;
50
51 # Full preemption
52 PREEMPT = lib.mkOverride 60 yes;
53 PREEMPT_VOLUNTARY = lib.mkOverride 60 no;
54
55 # Google's BBRv3 TCP congestion Control
56 TCP_CONG_BBR = yes;
57 DEFAULT_BBR = yes;
58
59 # Preemptive Full Tickless Kernel at 250Hz
60 HZ = freeform "250";
61 HZ_250 = yes;
62 HZ_1000 = no;
63
64 # RCU_BOOST and RCU_EXP_KTHREAD
65 RCU_EXPERT = yes;
66 RCU_FANOUT = freeform "64";
67 RCU_FANOUT_LEAF = freeform "16";
68 RCU_BOOST = yes;
69 RCU_BOOST_DELAY = freeform "0";
70 RCU_EXP_KTHREAD = yes;
71 };
72
73 extraMeta = {
74 branch = lib.versions.majorMinor version;
75 maintainers = with lib.maintainers; [
76 moni
77 lovesegfault
78 atemu
79 zzzsy
80 eljamm
81 ];
82 teams = [ ];
83 description = "Built with custom settings and new features built to provide a stable, responsive and smooth desktop experience";
84 broken = stdenv.hostPlatform.isAarch64;
85 };
86 }
87 // (args.argsOverride or { })
88 );
89in
90xanmodKernelFor variants.${variant}