2022-12-31 05:52:38 -05:00
|
|
|
{ config, lib, ... }:
|
2022-08-07 05:16:37 -04:00
|
|
|
let
|
|
|
|
cfg = config.hardware.raspberry-pi."4".apply-overlays-dtmerge;
|
2022-12-31 05:52:38 -05:00
|
|
|
dt_ao_overlay = _final: prev: {
|
2023-10-10 17:58:03 -04:00
|
|
|
deviceTree = prev.deviceTree // {
|
|
|
|
applyOverlays = _final.callPackage ./apply-overlays-dtmerge.nix { };
|
|
|
|
};
|
2022-12-31 05:52:38 -05:00
|
|
|
};
|
2022-08-07 05:16:37 -04:00
|
|
|
in {
|
|
|
|
options.hardware = {
|
|
|
|
raspberry-pi."4".apply-overlays-dtmerge = {
|
|
|
|
enable = lib.mkEnableOption ''
|
|
|
|
replace deviceTree.applyOverlays implementation to use dtmerge from libraspberrypi.
|
2022-08-08 12:27:49 -04:00
|
|
|
this can resolve issues with applying dtbs for the pi.
|
2022-08-07 05:16:37 -04:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
nixpkgs.overlays = [ dt_ao_overlay ];
|
|
|
|
};
|
|
|
|
}
|