2023-09-30 17:07:49 -07:00
|
|
|
{ pkgs, ... }: {
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
libraspberrypi
|
|
|
|
|
raspberrypi-eeprom
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
fileSystems."/" = {
|
2023-09-30 22:39:53 -07:00
|
|
|
device = "/dev/disk/by-label/NIXOS_SD";
|
2023-09-30 17:07:49 -07:00
|
|
|
fsType = "ext4";
|
2023-09-30 22:39:53 -07:00
|
|
|
options = [ "noatime" ];
|
2023-09-30 21:59:04 -07:00
|
|
|
autoResize = true;
|
2023-09-30 17:07:49 -07:00
|
|
|
};
|
2023-09-30 19:07:45 -07:00
|
|
|
programs.partition-manager.enable = false;
|
|
|
|
|
|
|
|
|
|
services.printing.enable = false;
|
2023-09-30 17:07:49 -07:00
|
|
|
services.btrfs.autoScrub.enable = false;
|
|
|
|
|
|
2023-09-30 23:35:09 -07:00
|
|
|
boot = {
|
|
|
|
|
# initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
|
|
|
|
|
initrd.availableKernelModules = [ "xhci_pci" ];
|
|
|
|
|
kernelParams = [
|
|
|
|
|
"8250.nr_uarts=1"
|
|
|
|
|
"cma=128M"
|
|
|
|
|
"console=tty1"
|
|
|
|
|
# "console=ttyAMA0,115200"
|
|
|
|
|
];
|
|
|
|
|
loader = {
|
|
|
|
|
raspberryPi = {
|
|
|
|
|
enable = true;
|
|
|
|
|
version = 4;
|
|
|
|
|
};
|
|
|
|
|
systemd-boot.enable = false;
|
|
|
|
|
generic-extlinux-compatible.enable = false;
|
|
|
|
|
};
|
|
|
|
|
kernelPackages = pkgs.linuxPackages_rpi4;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
powerManagement.cpuFreqGovernor = "ondemand";
|
2023-09-30 17:07:49 -07:00
|
|
|
|
|
|
|
|
hardware = {
|
|
|
|
|
raspberry-pi."4" = {
|
2023-09-30 23:35:09 -07:00
|
|
|
apply-overlays-dtmerge.enable = true;
|
|
|
|
|
audio.enable = true;
|
2023-10-01 01:00:49 +00:00
|
|
|
fkms-3d.enable = true;
|
2023-09-30 17:07:49 -07:00
|
|
|
};
|
2023-09-30 23:35:09 -07:00
|
|
|
deviceTree = {
|
|
|
|
|
enable = true;
|
|
|
|
|
filter = "*rpi-4-*.dtb";
|
|
|
|
|
};
|
2023-09-30 17:07:49 -07:00
|
|
|
};
|
2023-09-30 23:38:04 -07:00
|
|
|
|
2023-09-30 23:35:09 -07:00
|
|
|
hardware.deviceTree.overlays = [{
|
2023-09-30 23:38:04 -07:00
|
|
|
name = "hifiberry-dacplusadc";
|
2023-09-30 23:35:09 -07:00
|
|
|
dtsText = ''
|
2023-09-30 23:38:04 -07:00
|
|
|
// Definitions for HiFiBerry DAC+
|
|
|
|
|
/dts-v1/;
|
|
|
|
|
/plugin/;
|
2023-09-30 23:35:09 -07:00
|
|
|
|
2023-09-30 23:38:04 -07:00
|
|
|
/ {
|
2023-09-30 23:38:04 -07:00
|
|
|
compatible = "brcm,bcm2711";
|
2023-09-30 23:38:04 -07:00
|
|
|
|
2023-09-30 23:38:04 -07:00
|
|
|
fragment@0 {
|
|
|
|
|
target-path = "/";
|
|
|
|
|
__overlay__ {
|
|
|
|
|
dacpro_osc: dacpro_osc {
|
|
|
|
|
compatible = "hifiberry,dacpro-clk";
|
|
|
|
|
#clock-cells = <0>;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-09-30 23:38:04 -07:00
|
|
|
|
2023-09-30 23:38:04 -07:00
|
|
|
fragment@1 {
|
|
|
|
|
target = <&i2s>;
|
|
|
|
|
__overlay__ {
|
|
|
|
|
status = "okay";
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-09-30 23:38:04 -07:00
|
|
|
|
2023-09-30 23:38:04 -07:00
|
|
|
fragment@2 {
|
|
|
|
|
target = <&i2c1>;
|
|
|
|
|
__overlay__ {
|
|
|
|
|
#address-cells = <1>;
|
|
|
|
|
#size-cells = <0>;
|
|
|
|
|
status = "okay";
|
2023-09-30 23:38:04 -07:00
|
|
|
|
2023-09-30 23:38:04 -07:00
|
|
|
pcm5122@4d {
|
|
|
|
|
#sound-dai-cells = <0>;
|
|
|
|
|
compatible = "ti,pcm5122";
|
|
|
|
|
reg = <0x4d>;
|
|
|
|
|
clocks = <&dacpro_osc>;
|
|
|
|
|
AVDD-supply = <&vdd_3v3_reg>;
|
|
|
|
|
DVDD-supply = <&vdd_3v3_reg>;
|
|
|
|
|
CPVDD-supply = <&vdd_3v3_reg>;
|
|
|
|
|
status = "okay";
|
|
|
|
|
};
|
|
|
|
|
hpamp: hpamp@60 {
|
|
|
|
|
compatible = "ti,tpa6130a2";
|
|
|
|
|
reg = <0x60>;
|
|
|
|
|
status = "disabled";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-09-30 23:38:04 -07:00
|
|
|
|
2023-09-30 23:38:04 -07:00
|
|
|
fragment@3 {
|
|
|
|
|
target = <&sound>;
|
|
|
|
|
hifiberry_dacplus: __overlay__ {
|
|
|
|
|
compatible = "hifiberry,hifiberry-dacplus";
|
|
|
|
|
i2s-controller = <&i2s>;
|
|
|
|
|
status = "okay";
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-09-30 23:38:04 -07:00
|
|
|
|
2023-09-30 23:38:04 -07:00
|
|
|
__overrides__ {
|
|
|
|
|
24db_digital_gain =
|
|
|
|
|
<&hifiberry_dacplus>,"hifiberry,24db_digital_gain?";
|
|
|
|
|
slave = <&hifiberry_dacplus>,"hifiberry-dacplus,slave?";
|
|
|
|
|
leds_off = <&hifiberry_dacplus>,"hifiberry-dacplus,leds_off?";
|
|
|
|
|
};
|
2023-09-30 23:38:04 -07:00
|
|
|
};
|
|
|
|
|
'';
|
|
|
|
|
}];
|
2023-09-30 17:07:49 -07:00
|
|
|
|
|
|
|
|
nixpkgs.hostPlatform = "aarch64-linux";
|
2023-09-30 18:47:13 -07:00
|
|
|
system.stateVersion = "23.11";
|
2023-09-30 17:07:49 -07:00
|
|
|
networking.hostName = "NObangers";
|
|
|
|
|
}
|