mio-ops/hardware/raspberry_pi_3_model_B.nix

66 lines
1.7 KiB
Nix

# Configuration common to all Raspberry Pi 3 Model B devices
{ config, pkgs, lib, ... }:
{
boot = {
initrd = {
availableKernelModules = [
"usbhid"
"usb_storage"
];
};
kernelPackages = pkgs.linuxPackages_latest; # For a Raspberry Pi 2 or 3)
kernelParams = [
"cma=32M" # Needed for the virtual console to work on the RPi 3
"console=ttyS1,115200n8" # Enable the serial console
];
loader = {
generic-extlinux-compatible = {
enable = true; # Enables the generation of /boot/extlinux/extlinux.conf
};
grub = {
enable = false; # NixOS wants to enable GRUB by default.
};
raspberryPi = {
enable = true;
version = 3;
uboot.enable = true;
firmwareConfig = ''
arm_64bit=1 # Force kernel loading system to assume a 64-bit kernel
hdmi_force_hotplug=1 # Enable headless booting
'';
};
};
};
# File systems configuration for using the installer's partition layout
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
"/var" = {
device = "/dev/disk/by-label/var";
fsType = "ext4";
};
};
# !!! Adding a swap file is optional, but strongly recommended!
swapDevices = [ { device = "/swapfile"; size = 1024; } ];
hardware = {
enableRedistributableFirmware = true; # Enable support for Pi firmware blobs
};
networking = {
enableB43Firmware = false; # If true, enable Pi wireless firmware
};
environment.systemPackages = with pkgs; [
raspberrypi-tools # Userland tools for the Raspberry Pi board
];
}