Files
nix-config/modules/nixos/hardware/raspberry-pi/audio.nix
mjallen18 3b780d4d78 bruh
2026-01-05 23:31:06 -06:00

40 lines
913 B
Nix

{
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 =
[ ]
++ (with pkgs.${namespace}; (
if (variant == "5") then
[
{
name = "pisound-pi5-overlay";
dtsFile = "${raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-pi5-overlay.dts";
}
]
else
[
{
name = "pisound-overlay";
dtsFile = "${raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-overlay.dts";
}
]
));
};
};
}