11 # comments with variant added for update script
15 version = "6.12.10"; # zen
16 suffix = "zen1"; # zen
17 sha256 = "1kd3bcnhlarnrpl87mrdb5r9k2jdq7m8607ai847dkmncw7q2d1q"; # zen
22 version = "6.12.10"; # lqx
23 suffix = "lqx1"; # lqx
24 sha256 = "0sg905xdyy9wmjqv6d8p5jr307j767wgk27gzxhq8dnb2dz2yg5v"; # lqx
39 pname = "linux-${if isLqx then "lqx" else "zen"}";
40 modDirVersion = lib.versions.pad 3 "${version}-${suffix}";
43 src = fetchFromGitHub {
46 rev = "v${version}-${suffix}";
50 # This is based on the following sources:
51 # - zen: https://gitlab.archlinux.org/archlinux/packaging/packages/linux-zen/-/blob/main/config
52 # - lqx: https://github.com/damentz/liquorix-package/blob/6.8/master/linux-liquorix/debian/config/kernelarch-x86/config-arch-64
53 # - Liquorix features: https://liquorix.net/
54 # The list below is not exhaustive, so the kernels probably doesn't match
55 # the upstream, but should bring most of the improvements that will be
57 structuredExtraConfig =
60 # Zen Interactive tuning
61 ZEN_INTERACTIVE = yes;
63 # FQ-Codel Packet Scheduling
64 NET_SCH_DEFAULT = yes;
65 DEFAULT_FQ_CODEL = yes;
67 # Preempt (low-latency)
68 PREEMPT = lib.mkOverride 60 yes;
69 PREEMPT_VOLUNTARY = lib.mkOverride 60 no;
71 # Preemptible tree-based hierarchical RCU
76 TASKS_RCU_GENERIC = yes;
79 TASKS_TRACE_RCU = yes;
80 RCU_STALL_COMMON = yes;
81 RCU_NEED_SEGCBLIST = yes;
82 RCU_FANOUT = freeform "64";
83 RCU_FANOUT_LEAF = freeform "16";
85 RCU_BOOST_DELAY = option (freeform "500");
88 RCU_DOUBLE_CHECK_CB_TIME = yes;
91 IOSCHED_BFQ = lib.mkOverride 60 yes;
93 # Futex WAIT_MULTIPLE implementation for Wine / Proton Fsync.
97 # NT synchronization primitive emulation
100 # Preemptive Full Tickless Kernel at 1000Hz
101 HZ = freeform "1000";
105 // lib.optionalAttrs (isLqx) {
106 # Google's BBRv3 TCP congestion Control
110 # PDS Process Scheduler
114 # https://github.com/damentz/liquorix-package/commit/a7055b936c0f4edb8f6afd5263fe1d2f8a5cd877
116 RCU_LAZY = lib.mkOverride 60 no;
118 # Swap storage is compressed with LZ4 using zswap
119 ZSWAP_COMPRESSOR_DEFAULT_LZ4 = lib.mkOptionDefault yes;
120 ZSWAP_COMPRESSOR_DEFAULT_ZSTD = lib.mkDefault no;
122 # Fix error: unused option: XXX.
123 CFS_BANDWIDTH = lib.mkForce (option no);
124 PSI = lib.mkForce (option no);
125 RT_GROUP_SCHED = lib.mkForce (option no);
126 SCHED_AUTOGROUP = lib.mkForce (option no);
127 SCHED_CLASS_EXT = lib.mkForce (option no);
128 SCHED_CORE = lib.mkForce (option no);
129 UCLAMP_TASK = lib.mkForce (option no);
130 UCLAMP_TASK_GROUP = lib.mkForce (option no);
133 passthru.updateScript = [
135 (if isLqx then "lqx" else "zen")
139 branch = lib.versions.majorMinor version + "/master";
140 maintainers = with lib.maintainers; [
145 "Built using the best configuration and kernel sources for desktop, multimedia, and gaming workloads."
146 + lib.optionalString isLqx " (Same as linux_zen, but less aggressive release schedule and additional extra config)";
147 broken = stdenv.hostPlatform.isAarch64;
151 // (args.argsOverride or { })
154 zenKernelsFor variants.${variant}