2024-06-12 15:00:55 +02:00
|
|
|
{ inputs, pkgs, ... }: {
|
2024-04-03 10:38:55 +02:00
|
|
|
imports = [
|
|
|
|
inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
|
|
|
];
|
|
|
|
kyouma.machine-type.physical = true;
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
extraModprobeConfig = ''
|
|
|
|
options snd_bcm2835 enable_headphones=1
|
|
|
|
'';
|
|
|
|
kernelParams = [ "snd_bcm2835.enable_hdmi=1" ];
|
|
|
|
loader.raspberryPi.firmwareConfig = ''
|
|
|
|
dtparam=audio=on
|
|
|
|
dtparam=krnbt=on
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
console.enable = false;
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
bluez
|
|
|
|
bluez-tools
|
|
|
|
libcec
|
|
|
|
libraspberrypi
|
|
|
|
raspberrypi-eeprom
|
|
|
|
];
|
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "/dev/disk/by-label/NIXOS_SD";
|
|
|
|
fsType = "ext4";
|
|
|
|
options = [ "noatime" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
hardware = {
|
|
|
|
bluetooth.enable = true;
|
|
|
|
pulseaudio.enable = true;
|
|
|
|
deviceTree = {
|
|
|
|
enable = true;
|
|
|
|
overlays = [
|
|
|
|
{
|
|
|
|
name = "bluetooth-overlay";
|
|
|
|
dtsText = ''
|
|
|
|
/dts-v1/;
|
|
|
|
/plugin/;
|
|
|
|
/ {
|
|
|
|
compatible = "brcm,bcm2711";
|
|
|
|
fragment@0 {
|
|
|
|
target = <&uart0_pins>;
|
|
|
|
__overlay__ {
|
|
|
|
brcm,pins = <30 31 32 33>;
|
|
|
|
brcm,pull = <2 0 0 2>;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
raspberry-pi."4" = {
|
|
|
|
apply-overlays-dtmerge.enable = true;
|
|
|
|
fkms-3d.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
(self: super: { libcec = super.libcec.override { withLibraspberrypi = true; }; })
|
2024-05-10 16:21:18 +02:00
|
|
|
(self: super: {
|
|
|
|
makeModulesClosure = x:
|
|
|
|
super.makeModulesClosure (x // { allowMissing = true; });
|
|
|
|
})
|
2024-04-03 10:38:55 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
sound.enable = true;
|
|
|
|
services.avahi = {
|
|
|
|
enable = true;
|
|
|
|
ipv6 = true;
|
|
|
|
nssmdns4 = true;
|
|
|
|
publish.enable = true;
|
|
|
|
publish.userServices = true;
|
|
|
|
};
|
|
|
|
services.fstrim.enable = true;
|
|
|
|
}
|