dtsoverlays

This commit is contained in:
mjallen18
2025-12-29 19:22:11 -06:00
parent 82e062a7e8
commit 209e776640
14 changed files with 315 additions and 53 deletions

View File

@@ -0,0 +1,30 @@
{ config, lib, pkgs, namespace, ... }:
let
cfg = config.${namespace}.hardware.raspberry-pi.audio;
variant = config.${namespace}.hardware.raspberry-pi.variant;
in
{
options.${namespace}.hardware.raspberry-pi.audio = {
enable = lib.mkEnableOption "enable audio dt overlays";
};
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays =
[ ] ++ (if (variant == "5") then
[
{
name = "pisound-pi5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/share/raspberrypi-overlays/pisound-pi5-overlay.dts";
}
]
else
[
{
name = "pisound-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/share/raspberrypi-overlays/pisound-overlay.dts";
}
]);
};
};
}