78 lines
1.7 KiB
Nix
78 lines
1.7 KiB
Nix
|
{ config, inputs, lib, pkgs, ... }: {
|
||
|
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; }; })
|
||
|
];
|
||
|
|
||
|
sound.enable = true;
|
||
|
services.avahi = {
|
||
|
enable = true;
|
||
|
ipv6 = true;
|
||
|
nssmdns4 = true;
|
||
|
publish.enable = true;
|
||
|
publish.userServices = true;
|
||
|
};
|
||
|
services.fstrim.enable = true;
|
||
|
}
|