raspberry-pi/4: Add audio option

This commit is contained in:
Vincent Breitmoser 2021-08-14 17:17:21 +02:00
parent 7da029f268
commit 745dd44071
2 changed files with 41 additions and 0 deletions

40
raspberry-pi/4/audio.nix Normal file
View file

@ -0,0 +1,40 @@
{ config, lib, pkgs, ... }:
let
cfg = config.hardware.raspberry-pi."4".audio;
in
{
options.hardware = {
raspberry-pi."4".audio = {
enable = lib.mkEnableOption ''
configuration for audio
'';
};
};
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays = [
# Equivalent to dtparam=audio=on
{
name = "audio-on-overlay";
dtsText = ''
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2711";
fragment@0 {
target = <&audio>;
__overlay__ {
status = "okay";
};
};
};
'';
}
];
};
};
}

View file

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./audio.nix
./dwc2.nix ./dwc2.nix
./modesetting.nix ./modesetting.nix
./poe-hat.nix ./poe-hat.nix