From 4c202a6d1290e36eceb805742cbe76e181291f4c Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sat, 24 Sep 2022 03:06:26 -0700 Subject: [PATCH] platform/kevin: factor out modules_{no}insmod as a let-block --- src/platform/kevin/default.nix | 67 ++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/src/platform/kevin/default.nix b/src/platform/kevin/default.nix index 876abff..eef1c54 100644 --- a/src/platform/kevin/default.nix +++ b/src/platform/kevin/default.nix @@ -1,4 +1,36 @@ -{ +let + # order matters! this is also the order in which the modules are insmoded + modules_insmod = [ + "drivers/video/backlight/pwm_bl.ko" + "drivers/gpu/drm/panel/panel-simple.ko" + "drivers/gpu/drm/bridge/analogix/analogix_dp.ko" + "drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.ko" + "drivers/gpu/drm/bridge/synopsys/dw-hdmi.ko" + "drivers/gpu/drm/rockchip/rockchipdrm.ko" + "drivers/usb/dwc3/dwc3-of-simple.ko" + "drivers/usb/dwc3/dwc3.ko" + "drivers/usb/host/ehci-hcd.ko" + "drivers/usb/host/ehci-platform.ko" + "drivers/usb/host/ohci-hcd.ko" + "drivers/usb/host/ohci-platform.ko" + "drivers/usb/storage/usb-storage.ko" + "drivers/usb/storage/uas.ko" + "drivers/usb/host/xhci-hcd.ko" + "drivers/usb/host/xhci-plat-hcd.ko" + ]; + # FIXME: need firmware for mwifiex and ath9k as well. + modules_noinsmod = [ + "lib/crypto/libarc4.ko" + "net/mac80211/mac80211.ko" + "drivers/net/wireless/ath/ath9k/ath9k.ko" + "drivers/net/wireless/ath/ath9k/ath9k_common.ko" + "drivers/net/wireless/ath/ath9k/ath9k_htc.ko" + "drivers/net/wireless/ath/ath9k/ath9k_hw.ko" + "drivers/net/wireless/ath/ath.ko" + "drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko" + "drivers/net/wireless/marvell/mwifiex/mwifiex.ko" + ]; +in { hostPlatform = (import ).systems.examples.aarch64-multiplatform; overlay = (final: prev: { @@ -25,37 +57,8 @@ }); userspace = prev.userspace.override { - # order matters! this is also the order in which the modules are insmoded - modules_insmod = [ - "drivers/video/backlight/pwm_bl.ko" - "drivers/gpu/drm/panel/panel-simple.ko" - "drivers/gpu/drm/bridge/analogix/analogix_dp.ko" - "drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.ko" - "drivers/gpu/drm/bridge/synopsys/dw-hdmi.ko" - "drivers/gpu/drm/rockchip/rockchipdrm.ko" - "drivers/usb/dwc3/dwc3-of-simple.ko" - "drivers/usb/dwc3/dwc3.ko" - "drivers/usb/host/ehci-hcd.ko" - "drivers/usb/host/ehci-platform.ko" - "drivers/usb/host/ohci-hcd.ko" - "drivers/usb/host/ohci-platform.ko" - "drivers/usb/storage/usb-storage.ko" - "drivers/usb/storage/uas.ko" - "drivers/usb/host/xhci-hcd.ko" - "drivers/usb/host/xhci-plat-hcd.ko" - ]; - # FIXME: need firmware for mwifiex and ath9k as well. - modules_noinsmod = [ - "lib/crypto/libarc4.ko" - "net/mac80211/mac80211.ko" - "drivers/net/wireless/ath/ath9k/ath9k.ko" - "drivers/net/wireless/ath/ath9k/ath9k_common.ko" - "drivers/net/wireless/ath/ath9k/ath9k_htc.ko" - "drivers/net/wireless/ath/ath9k/ath9k_hw.ko" - "drivers/net/wireless/ath/ath.ko" - "drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko" - "drivers/net/wireless/marvell/mwifiex/mwifiex.ko" - ]; + inherit modules_insmod; + inherit modules_noinsmod; }; coreboot =