1# This module enables all hardware supported by NixOS: i.e., all
2# firmware is included, and all devices from which one may boot are
3# enabled in the initrd. Its primary use is in the NixOS installation
4# CDs.
5
6{
7 config,
8 lib,
9 pkgs,
10 ...
11}:
12let
13 platform = pkgs.stdenv.hostPlatform;
14in
15{
16
17 options = {
18 hardware.enableAllHardware = lib.mkEnableOption "Enable support for most hardware";
19 };
20
21 config = lib.mkIf config.hardware.enableAllHardware {
22
23 # The initrd has to contain any module that might be necessary for
24 # supporting the most important parts of HW like drives.
25 boot.initrd.availableKernelModules = [
26 # SATA/PATA support.
27 "ahci"
28
29 "ata_piix"
30
31 "sata_inic162x"
32 "sata_nv"
33 "sata_promise"
34 "sata_qstor"
35 "sata_sil"
36 "sata_sil24"
37 "sata_sis"
38 "sata_svw"
39 "sata_sx4"
40 "sata_uli"
41 "sata_via"
42 "sata_vsc"
43
44 "pata_ali"
45 "pata_amd"
46 "pata_artop"
47 "pata_atiixp"
48 "pata_efar"
49 "pata_hpt366"
50 "pata_hpt37x"
51 "pata_hpt3x2n"
52 "pata_hpt3x3"
53 "pata_it8213"
54 "pata_it821x"
55 "pata_jmicron"
56 "pata_marvell"
57 "pata_mpiix"
58 "pata_netcell"
59 "pata_ns87410"
60 "pata_oldpiix"
61 "pata_pcmcia"
62 "pata_pdc2027x"
63 "pata_qdi"
64 "pata_rz1000"
65 "pata_serverworks"
66 "pata_sil680"
67 "pata_sis"
68 "pata_sl82c105"
69 "pata_triflex"
70 "pata_via"
71 "pata_winbond"
72
73 # SCSI support (incomplete).
74 "3w-9xxx"
75 "3w-xxxx"
76 "aic79xx"
77 "aic7xxx"
78 "arcmsr"
79 "hpsa"
80
81 # USB support, especially for booting from USB CD-ROM
82 # drives.
83 "uas"
84
85 # SD cards.
86 "sdhci_pci"
87
88 # NVMe drives
89 "nvme"
90
91 # Firewire support. Not tested.
92 "ohci1394"
93 "sbp2"
94
95 # Virtio (QEMU, KVM etc.) support.
96 "virtio_net"
97 "virtio_pci"
98 "virtio_mmio"
99 "virtio_blk"
100 "virtio_scsi"
101 "virtio_balloon"
102 "virtio_console"
103
104 # VMware support.
105 "mptspi"
106 "vmxnet3"
107 "vsock"
108 ]
109 ++ lib.optional platform.isx86 "vmw_balloon"
110 ++ lib.optionals (pkgs.stdenv.hostPlatform.isi686 || pkgs.stdenv.hostPlatform.isx86_64) [
111 "vmw_vmci"
112 "vmwgfx"
113 "vmw_vsock_vmci_transport"
114
115 # Hyper-V support.
116 "hv_storvsc"
117 ]
118 ++ lib.optionals pkgs.stdenv.hostPlatform.isAarch [
119 # Allwinner support
120 # Required for early KMS
121 "sun4i-drm"
122 "sun8i-mixer" # Audio, but required for kms
123
124 # PWM for the backlight
125 "pwm-sun4i"
126
127 # Broadcom
128 "vc4"
129 ]
130 ++ lib.optionals pkgs.stdenv.hostPlatform.isAarch64 [
131 # Most of the following falls into two categories:
132 # - early KMS / early display
133 # - early storage (e.g. USB) support
134
135 # Broadcom
136
137 "pcie-brcmstb"
138
139 # Rockchip
140 "dw-hdmi"
141 "dw-mipi-dsi"
142 "rockchipdrm"
143 "rockchip-rga"
144 "phy-rockchip-pcie"
145 "pcie-rockchip-host"
146
147 # Misc. uncategorized hardware
148
149 # Used for some platform's integrated displays
150 "panel-simple"
151 "pwm-bl"
152
153 # Power supply drivers, some platforms need them for USB
154 "axp20x-ac-power"
155 "axp20x-battery"
156 "pinctrl-axp209"
157 "mp8859"
158
159 # USB drivers
160 "xhci-pci-renesas"
161
162 # Reset controllers
163 "reset-raspberrypi" # Triggers USB chip firmware load.
164
165 # Misc "weak" dependencies
166 "analogix-dp"
167 "analogix-anx6345" # For DP or eDP (e.g. integrated display)
168 ];
169
170 # Include lots of firmware.
171 hardware.enableRedistributableFirmware = true;
172 };
173}