2022-08-07 11:16:37 +02:00
|
|
|
{ config, lib, pkgs, modulesPath, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.hardware.raspberry-pi."4".apply-overlays-dtmerge;
|
|
|
|
dt_ao_overlay = (final: prev: {
|
2022-08-08 18:46:26 +02:00
|
|
|
deviceTree.applyOverlays = (prev.callPackage ./apply-overlays-dtmerge.nix { });
|
2022-08-07 11:16:37 +02: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 18:27:49 +02:00
|
|
|
this can resolve issues with applying dtbs for the pi.
|
2022-08-07 11:16:37 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
nixpkgs.overlays = [ dt_ao_overlay ];
|
|
|
|
};
|
|
|
|
}
|