feat: musicpi

This commit is contained in:
Philipp Hochkamp 2022-03-25 13:52:42 +01:00
parent 7a85f7cec6
commit 6477dee99b
4 changed files with 110 additions and 36 deletions

View file

@ -0,0 +1,53 @@
{ config, lib, pkgs, ... }:
let
cfg = config.ragon.hardware.hifiberry-dac;
in
{
options.ragon.hardware.hifiberry-dac.enable = lib.mkEnableOption "Enables hifiberry dac";
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays = [
# Equivalent to: https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts
{
name = "hifiberry-dac-overlay";
dtsText = ''
// Definitions for HiFiBerry DAC
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target-path = "/";
__overlay__ {
pcm5102a-codec {
#sound-dai-cells = <0>;
compatible = "ti,pcm5102a";
status = "okay";
};
};
};
fragment@2 {
target = <&sound>;
__overlay__ {
compatible = "hifiberry,hifiberry-dac";
i2s-controller = <&i2s>;
status = "okay";
};
};
};
'';
}
];
};
};
}

View file

@ -1,36 +0,0 @@
{ config, lib, pkgs, ... }:
let
cfg = config.ragon.hardware.rpi3;
in
{
options.ragon.hardware.rpi3.enable = lib.mkEnableOption "Enables rpi3 quirks";
config = lib.mkIf cfg.enable {
boot.loader.raspberryPi = {
enable = true;
version = 3;
};
boot.extraModprobeConfig = ''
options cfg80211 ieee80211_regdom="DE"
'';
hardware.firmware = [ pkgs.wireless-regdb ];
#boot.kernelPackages = pkgs.linux_rpi3;
nixpkgs.overlays = [
(self: super: {
firmwareLinuxNonfree = super.firmwareLinuxNonfree.overrideAttrs (old: {
version = "2020-12-18";
src = pkgs.fetchgit {
url =
"https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git";
rev = "b79d2396bc630bfd9b4058459d3e82d7c3428599";
sha256 = "1rb5b3fzxk5bi6kfqp76q1qszivi0v1kdz1cwj2llp5sd9ns03b5";
};
outputHash = "1p7vn2hfwca6w69jhw5zq70w44ji8mdnibm1z959aalax6ndy146";
});
})
];
networking.wireless.enable = true;
hardware.enableRedistributableFirmware = true;
networking.wireless.interfaces = [ "wlan0" ];
};
}