@@ -3,20 +3,24 @@
33# enabled in the initrd. Its primary use is in the NixOS installation
44# CDs.
55
6−{ ... }:
7−
6+{ pkgs, lib,... }:
7+let
8+ platform = pkgs.stdenv.hostPlatform;
9+in
810{
911
1012 # The initrd has to contain any module that might be necessary for
1113 # supporting the most important parts of HW like drives.
1214 boot.initrd.availableKernelModules =
13− [ # SATA/PATA support.
15+ # SATA/PATA support.
16+ lib.optionals (!platform.isAarch64) [ # not sure where else they're missing
1417 "ahci"
15−
18+ "sata_sil24"
19+ ] ++ [
1620 "ata_piix"
1721
1822 "sata_inic162x" "sata_nv" "sata_promise" "sata_qstor"
19− "sata_sil" "sata_sil24" "sata_sis" "sata_svw" "sata_sx4"
23+ "sata_sil" "sata_sis" "sata_svw" "sata_sx4"
2024 "sata_uli" "sata_via" "sata_vsc"
2125
2226 "pata_ali" "pata_amd" "pata_artop" "pata_atiixp" "pata_efar"
@@ -38,13 +42,19 @@
3842 # Firewire support. Not tested.
3943 "ohci1394" "sbp2"
4044
45+ ] ++ lib.optionals (!platform.isAarch64) [ # not sure where else they're missing
4146 # Virtio (QEMU, KVM etc.) support.
4247 "virtio_net" "virtio_pci" "virtio_blk" "virtio_scsi" "virtio_balloon" "virtio_console"
48+ ] ++ [
4349
4450 # VMware support.
45− "mptspi" "vmw_balloon" "vmwgfx" "vmw_vmci" "vmw_vsock_vmci_transport" "vmxnet3" "vsock"
51+ "mptspi" "vmxnet3" "vsock"
52+ ] ++ lib.optionals (!platform.isAarch64) [ # not sure where else they're missing
53+ "vmw_vmci" "vmwgfx" "vmw_vsock_vmci_transport"
54+ ] ++ lib.optional platform.isx86 "vmw_balloon"
4655
4756 # Hyper-V support.
57+ ++ lib.optionals (!platform.isAarch64) [ # not sure where else they're missing
4858 "hv_storvsc"
4959 ];
5060