1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-12-23 18:19:44 +01:00

Merge pull request #301 from Valodim/rpi-4-audio

rpi4: add module for audio settings
This commit is contained in:
Jörg Thalheim 2021-08-15 07:03:05 +01:00 committed by GitHub
commit 566f4da366
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 = [
./audio.nix
./dwc2.nix
./modesetting.nix
./poe-hat.nix