fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1/*
2
3 WARNING/NOTE: whenever you want to add an option here you need to
4 either
5
6 * mark it as an optional one with `?` suffix,
7 * or make sure it works for all the versions in nixpkgs,
8 * or check for which kernel versions it will work (using kernel
9 changelog, google or whatever) and mark it with `versionOlder` or
10 `versionAtLeast`.
11
12 Then do test your change by building all the kernels (or at least
13 their configs) in nixpkgs or else you will guarantee lots and lots
14 of pain to users trying to switch to an older kernel because of some
15 hardware problems with a new one.
16
17*/
18
19{ stdenv, version, kernelPlatform, extraConfig, features }:
20
21with stdenv.lib;
22
23''
24 # Debugging.
25 DEBUG_KERNEL y
26 TIMER_STATS y
27 BACKTRACE_SELF_TEST n
28 CPU_NOTIFIER_ERROR_INJECT? n
29 DEBUG_DEVRES n
30 DEBUG_NX_TEST n
31 DEBUG_STACK_USAGE n
32 ${optionalString (!(features.grsecurity or false)) ''
33 DEBUG_STACKOVERFLOW n
34 ''}
35 RCU_TORTURE_TEST n
36 SCHEDSTATS n
37 DETECT_HUNG_TASK y
38
39 # Power management.
40 ${optionalString (versionOlder version "3.19") ''
41 PM_RUNTIME y
42 ''}
43 PM_ADVANCED_DEBUG y
44 ${optionalString (versionAtLeast version "3.10") ''
45 X86_INTEL_PSTATE y
46 ''}
47 INTEL_IDLE y
48 CPU_FREQ_DEFAULT_GOV_PERFORMANCE y
49 ${optionalString (versionOlder version "3.10") ''
50 USB_SUSPEND y
51 ''}
52
53 # Support drivers that need external firmware.
54 STANDALONE n
55
56 # Make /proc/config.gz available.
57 IKCONFIG y
58 IKCONFIG_PROC y
59
60 # Optimize with -O2, not -Os.
61 CC_OPTIMIZE_FOR_SIZE n
62
63 # Enable the kernel's built-in memory tester.
64 MEMTEST y
65
66 # Include the CFQ I/O scheduler in the kernel, rather than as a
67 # module, so that the initrd gets a good I/O scheduler.
68 IOSCHED_CFQ y
69 BLK_CGROUP y # required by CFQ
70
71 # Enable NUMA.
72 NUMA? y
73
74 # Disable some expensive (?) features.
75 PM_TRACE_RTC n
76
77 # Enable various subsystems.
78 ACCESSIBILITY y # Accessibility support
79 AUXDISPLAY y # Auxiliary Display support
80 DONGLE y # Serial dongle support
81 HIPPI y
82 MTD_COMPLEX_MAPPINGS y # needed for many devices
83 ${optionalString (versionOlder version "3.2") ''
84 NET_POCKET y # enable pocket and portable adapters
85 ''}
86 SCSI_LOWLEVEL y # enable lots of SCSI devices
87 SCSI_LOWLEVEL_PCMCIA y
88 SCSI_SAS_ATA y # added to enable detection of hard drive
89 SPI y # needed for many devices
90 SPI_MASTER y
91 WAN y
92
93 # Networking options.
94 IP_PNP n
95 ${optionalString (versionOlder version "3.13") ''
96 IPV6_PRIVACY y
97 ''}
98 NETFILTER_ADVANCED y
99 IP_VS_PROTO_TCP y
100 IP_VS_PROTO_UDP y
101 IP_VS_PROTO_ESP y
102 IP_VS_PROTO_AH y
103 IP_DCCP_CCID3 n # experimental
104 CLS_U32_PERF y
105 CLS_U32_MARK y
106 ${optionalString (stdenv.system == "x86_64-linux") ''
107 BPF_JIT y
108 ''}
109
110 # Wireless networking.
111 CFG80211_WEXT? y # Without it, ipw2200 drivers don't build
112 IPW2100_MONITOR? y # support promiscuous mode
113 IPW2200_MONITOR? y # support promiscuous mode
114 HOSTAP_FIRMWARE? y # Support downloading firmware images with Host AP driver
115 HOSTAP_FIRMWARE_NVRAM? y
116 ATH9K_PCI? y # Detect Atheros AR9xxx cards on PCI(e) bus
117 ATH9K_AHB? y # Ditto, AHB bus
118 ${optionalString (versionAtLeast version "3.2") ''
119 B43_PHY_HT? y
120 ''}
121 BCMA_HOST_PCI? y
122
123 # Enable various FB devices.
124 FB y
125 FB_EFI y
126 FB_NVIDIA_I2C y # Enable DDC Support
127 FB_RIVA_I2C y
128 FB_ATY_CT y # Mach64 CT/VT/GT/LT (incl. 3D RAGE) support
129 FB_ATY_GX y # Mach64 GX support
130 FB_SAVAGE_I2C y
131 FB_SAVAGE_ACCEL y
132 FB_SIS_300 y
133 FB_SIS_315 y
134 FB_3DFX_ACCEL y
135 FB_VESA y
136 FRAMEBUFFER_CONSOLE y
137 ${optionalString (versionOlder version "3.9" || stdenv.system == "i686-linux") ''
138 FB_GEODE y
139 ''}
140
141 # Video configuration.
142 # Enable KMS for devices whose X.org driver supports it.
143 ${optionalString (versionOlder version "4.3") ''
144 DRM_I915_KMS y
145 ''}
146 # Allow specifying custom EDID on the kernel command line
147 DRM_LOAD_EDID_FIRMWARE y
148 ${optionalString (versionOlder version "3.9") ''
149 DRM_RADEON_KMS? y
150 ''}
151 # Hybrid graphics support
152 VGA_SWITCHEROO y
153
154 # Sound.
155 SND_DYNAMIC_MINORS y
156 SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode
157 SND_HDA_INPUT_BEEP y # Support digital beep via input layer
158 SND_USB_CAIAQ_INPUT y
159 PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible)
160
161 # USB serial devices.
162 USB_SERIAL_GENERIC y # USB Generic Serial Driver
163 USB_SERIAL_KEYSPAN_MPR y # include firmware for various USB serial devices
164 USB_SERIAL_KEYSPAN_USA28 y
165 USB_SERIAL_KEYSPAN_USA28X y
166 USB_SERIAL_KEYSPAN_USA28XA y
167 USB_SERIAL_KEYSPAN_USA28XB y
168 USB_SERIAL_KEYSPAN_USA19 y
169 USB_SERIAL_KEYSPAN_USA18X y
170 USB_SERIAL_KEYSPAN_USA19W y
171 USB_SERIAL_KEYSPAN_USA19QW y
172 USB_SERIAL_KEYSPAN_USA19QI y
173 USB_SERIAL_KEYSPAN_USA49W y
174 USB_SERIAL_KEYSPAN_USA49WLC y
175
176 # Filesystem options - in particular, enable extended attributes and
177 # ACLs for all filesystems that support them.
178 FANOTIFY y
179 EXT2_FS_XATTR y
180 EXT2_FS_POSIX_ACL y
181 EXT2_FS_SECURITY y
182 ${optionalString (versionOlder version "4.0") ''
183 EXT2_FS_XIP y # Ext2 execute in place support
184 ''}
185 EXT3_FS_POSIX_ACL y
186 EXT3_FS_SECURITY y
187 EXT4_FS_POSIX_ACL y
188 EXT4_FS_SECURITY y
189 REISERFS_FS_XATTR? y
190 REISERFS_FS_POSIX_ACL? y
191 REISERFS_FS_SECURITY? y
192 JFS_POSIX_ACL? y
193 JFS_SECURITY? y
194 XFS_QUOTA? y
195 XFS_POSIX_ACL? y
196 XFS_RT? y # XFS Realtime subvolume support
197 OCFS2_DEBUG_MASKLOG? n
198 BTRFS_FS_POSIX_ACL y
199 UBIFS_FS_ADVANCED_COMPR? y
200 ${optionalString (versionAtLeast version "4.0") ''
201 NFSD_PNFS y
202 ''}
203 NFSD_V2_ACL y
204 NFSD_V3 y
205 NFSD_V3_ACL y
206 NFSD_V4 y
207 ${optionalString (versionAtLeast version "3.11") ''
208 NFSD_V4_SECURITY_LABEL y
209 ''}
210 NFS_FSCACHE y
211 ${optionalString (versionAtLeast version "3.6") ''
212 NFS_SWAP y
213 ''}
214 NFS_V3_ACL y
215 ${optionalString (versionAtLeast version "3.11") ''
216 NFS_V4_1 y # NFSv4.1 client support
217 NFS_V4_2 y
218 NFS_V4_SECURITY_LABEL y
219 ''}
220 CIFS_XATTR y
221 CIFS_POSIX y
222 CIFS_FSCACHE y
223 ${optionalString (versionAtLeast version "3.12") ''
224 CEPH_FSCACHE y
225 ''}
226 ${optionalString (versionAtLeast version "3.14") ''
227 CEPH_FS_POSIX_ACL y
228 ''}
229 ${optionalString (versionAtLeast version "3.13") ''
230 SQUASHFS_FILE_DIRECT y
231 SQUASHFS_DECOMP_MULTI_PERCPU y
232 ''}
233 SQUASHFS_XATTR y
234 SQUASHFS_ZLIB y
235 SQUASHFS_LZO y
236 SQUASHFS_XZ y
237 ${optionalString (versionAtLeast version "3.19") ''
238 SQUASHFS_LZ4 y
239 ''}
240
241 # Security related features.
242 STRICT_DEVMEM y # Filter access to /dev/mem
243 SECURITY_SELINUX_BOOTPARAM_VALUE 0 # Disable SELinux by default
244 ${optionalString (!(features.grsecurity or false)) ''
245 DEVKMEM n # Disable /dev/kmem
246 ''}
247 ${if versionOlder version "3.14" then ''
248 CC_STACKPROTECTOR? y # Detect buffer overflows on the stack
249 '' else ''
250 CC_STACKPROTECTOR_REGULAR? y
251 ''}
252 ${optionalString (versionAtLeast version "3.12") ''
253 USER_NS y # Support for user namespaces
254 ''}
255
256 # AppArmor support
257 SECURITY_APPARMOR y
258 DEFAULT_SECURITY_APPARMOR y
259
260 # Microcode loading support
261 MICROCODE y
262 MICROCODE_INTEL y
263 MICROCODE_AMD y
264 ${optionalString (versionAtLeast version "3.11") ''
265 MICROCODE_EARLY y
266 MICROCODE_INTEL_EARLY y
267 MICROCODE_AMD_EARLY y
268 ''}
269
270 # Misc. options.
271 8139TOO_8129 y
272 8139TOO_PIO n # PIO is slower
273 AIC79XX_DEBUG_ENABLE n
274 AIC7XXX_DEBUG_ENABLE n
275 AIC94XX_DEBUG n
276 ${optionalString (versionAtLeast version "3.3" && versionOlder version "3.13") ''
277 AUDIT_LOGINUID_IMMUTABLE y
278 ''}
279 B43_PCMCIA? y
280 BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
281 BLK_DEV_IDEACPI y # IDE ACPI support
282 BLK_DEV_INTEGRITY y
283 BSD_PROCESS_ACCT_V3 y
284 BT_HCIUART_BCSP? y
285 BT_HCIUART_H4? y # UART (H4) protocol support
286 BT_HCIUART_LL? y
287 ${optionalString (versionAtLeast version "3.4") ''
288 BT_RFCOMM_TTY? y # RFCOMM TTY support
289 ''}
290 CRASH_DUMP? n
291 ${optionalString (versionOlder version "3.1") ''
292 DMAR? n # experimental
293 ''}
294 DVB_DYNAMIC_MINORS? y # we use udev
295 ${optionalString (versionAtLeast version "3.3") ''
296 EFI_STUB y # EFI bootloader in the bzImage itself
297 ''}
298 FHANDLE y # used by systemd
299 FUSION y # Fusion MPT device support
300 IDE_GD_ATAPI y # ATAPI floppy support
301 IRDA_ULTRA y # Ultra (connectionless) protocol
302 JOYSTICK_IFORCE_232? y # I-Force Serial joysticks and wheels
303 JOYSTICK_IFORCE_USB? y # I-Force USB joysticks and wheels
304 JOYSTICK_XPAD_FF? y # X-Box gamepad rumble support
305 JOYSTICK_XPAD_LEDS? y # LED Support for Xbox360 controller 'BigX' LED
306 LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support
307 LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
308 LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
309 LOGO n # not needed
310 MEDIA_ATTACH y
311 MEGARAID_NEWGEN y
312 ${optionalString (versionAtLeast version "3.15") ''
313 MLX4_EN_VXLAN y
314 ''}
315 MODVERSIONS y
316 MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension
317 MTRR_SANITIZER y
318 NET_FC y # Fibre Channel driver support
319 PPP_MULTILINK y # PPP multilink support
320 PPP_FILTER y
321 REGULATOR y # Voltage and Current Regulator Support
322 ${optionalString (versionAtLeast version "3.6") ''
323 RC_DEVICES? y # Enable IR devices
324 ''}
325 ${optionalString (versionAtLeast version "3.10") ''
326 RT2800USB_RT55XX y
327 ''}
328 SCSI_LOGGING y # SCSI logging facility
329 SERIAL_8250 y # 8250/16550 and compatible serial support
330 SLIP_COMPRESSED y # CSLIP compressed headers
331 SLIP_SMART y
332 HWMON y
333 THERMAL_HWMON y # Hardware monitoring support
334 ${optionalString (versionAtLeast version "3.15") ''
335 UEVENT_HELPER n
336 ''}
337 ${optionalString (versionOlder version "3.15") ''
338 USB_DEBUG? n
339 ''}
340 USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
341 USB_EHCI_TT_NEWSCHED y # Improved transaction translator scheduling
342 X86_CHECK_BIOS_CORRUPTION y
343 X86_MCE y
344
345 # Linux containers.
346 NAMESPACES? y # Required by 'unshare' used by 'nixos-install'
347 RT_GROUP_SCHED? y
348 CGROUP_DEVICE? y
349 ${if versionAtLeast version "3.6" then ''
350 MEMCG y
351 MEMCG_SWAP y
352 '' else ''
353 CGROUP_MEM_RES_CTLR y
354 CGROUP_MEM_RES_CTLR_SWAP y
355 ''}
356 DEVPTS_MULTIPLE_INSTANCES y
357 BLK_DEV_THROTTLING y
358 CFQ_GROUP_IOSCHED y
359
360 # Enable staging drivers. These are somewhat experimental, but
361 # they generally don't hurt.
362 STAGING y
363
364 # PROC_EVENTS requires that the netlink connector is not built
365 # as a module. This is required by libcgroup's cgrulesengd.
366 CONNECTOR y
367 PROC_EVENTS y
368
369 # Tracing.
370 FTRACE y
371 KPROBES y
372 FUNCTION_TRACER y
373 FTRACE_SYSCALLS y
374 SCHED_TRACER y
375 STACK_TRACER y
376 ${optionalString (versionAtLeast version "3.10") ''
377 UPROBE_EVENT y
378 ''}
379 FUNCTION_PROFILER y
380 RING_BUFFER_BENCHMARK n
381
382 # Devtmpfs support.
383 DEVTMPFS y
384
385 # Easier debugging of NFS issues.
386 ${optionalString (versionAtLeast version "3.4") ''
387 SUNRPC_DEBUG y
388 ''}
389
390 # Virtualisation.
391 PARAVIRT? y
392 ${optionalString (!(features.grsecurity or false))
393 (if versionAtLeast version "3.10" then ''
394 HYPERVISOR_GUEST y
395 '' else ''
396 PARAVIRT_GUEST? y
397 '')
398 }
399 KVM_APIC_ARCHITECTURE y
400 KVM_ASYNC_PF y
401 ${optionalString (versionOlder version "3.7") ''
402 KVM_CLOCK? y
403 ''}
404 ${optionalString (versionAtLeast version "4.0") ''
405 KVM_COMPAT? y
406 ''}
407 ${optionalString (versionAtLeast version "3.10") ''
408 KVM_DEVICE_ASSIGNMENT? y
409 ''}
410 ${optionalString (versionAtLeast version "4.0") ''
411 KVM_GENERIC_DIRTYLOG_READ_PROTECT y
412 ''}
413 ${optionalString (!features.grsecurity or true) ''
414 KVM_GUEST y
415 ''}
416 KVM_MMIO y
417 ${optionalString (versionAtLeast version "3.13") ''
418 KVM_VFIO y
419 ''}
420 XEN? y
421 XEN_DOM0? y
422 ${optionalString ((versionAtLeast version "3.18") && (features.xen_dom0 or false)) ''
423 PCI_XEN? y
424 HVC_XEN? y
425 HVC_XEN_FRONTEND? y
426 XEN_SYS_HYPERVISOR? y
427 SWIOTLB_XEN? y
428 XEN_BACKEND? y
429 XEN_BALLOON? y
430 XEN_BALLOON_MEMORY_HOTPLUG? y
431 XEN_EFI? y
432 XEN_HAVE_PVMMU? y
433 XEN_MCE_LOG? y
434 XEN_PVH? y
435 XEN_PVHVM? y
436 XEN_SAVE_RESTORE? y
437 XEN_SCRUB_PAGES? y
438 XEN_SELFBALLOONING? y
439 XEN_STUB? y
440 XEN_TMEM? y
441 ''}
442 KSM y
443 ${optionalString (!stdenv.is64bit) ''
444 HIGHMEM64G? y # We need 64 GB (PAE) support for Xen guest support.
445 ''}
446 ${optionalString (versionAtLeast version "3.9" && stdenv.is64bit) ''
447 VFIO_PCI_VGA y
448 ''}
449 VIRT_DRIVERS y
450
451 # Media support.
452 ${optionalString (versionAtLeast version "3.6") ''
453 MEDIA_DIGITAL_TV_SUPPORT y
454 MEDIA_CAMERA_SUPPORT y
455 MEDIA_RC_SUPPORT y
456 ''}
457 ${optionalString (versionAtLeast version "3.7") ''
458 MEDIA_USB_SUPPORT y
459 ''}
460
461 # Our initrd init uses shebang scripts, so can't be modular.
462 ${optionalString (versionAtLeast version "3.10") ''
463 BINFMT_SCRIPT y
464 ''}
465
466 # Enable the 9P cache to speed up NixOS VM tests.
467 9P_FSCACHE? y
468 9P_FS_POSIX_ACL? y
469
470 # Enable transparent support for huge pages.
471 TRANSPARENT_HUGEPAGE? y
472 TRANSPARENT_HUGEPAGE_ALWAYS? n
473 TRANSPARENT_HUGEPAGE_MADVISE? y
474
475 # zram support (e.g for in-memory compressed swap).
476 ${optionalString (versionAtLeast version "3.4") ''
477 ZSMALLOC y
478 ''}
479 ZRAM m
480
481 # Enable firmware loading via udev (legacy).
482 ${optionalString (versionAtLeast version "3.17") ''
483 FW_LOADER_USER_HELPER_FALLBACK y
484 ''}
485
486 # Enable PCIe and USB for the brcmfmac driver
487 BRCMFMAC_USB? y
488 BRCMFMAC_PCIE? y
489
490 ${kernelPlatform.kernelExtraConfig or ""}
491 ${extraConfig}
492''