mio-ops/hardware/raspberry_pi_3_model_B.nix

66 lines
1.7 KiB
Nix
Raw Normal View History

2019-06-26 13:25:32 +00:00
# Configuration common to all Raspberry Pi 3 Model B devices
{ config, pkgs, lib, ... }:
{
2019-10-15 15:22:23 +00:00
2019-10-15 23:21:58 +00:00
boot = {
initrd = {
availableKernelModules = [
"usbhid"
"usb_storage"
];
};
kernelPackages = pkgs.linuxPackages_latest; # For a Raspberry Pi 2 or 3)
2019-10-17 01:50:37 +00:00
kernelParams = [
2019-10-17 01:56:29 +00:00
"cma=32M" # Needed for the virtual console to work on the RPi 3
2019-10-17 01:50:37 +00:00
"console=ttyS1,115200n8" # Enable the serial console
];
2019-10-15 23:21:58 +00:00
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;
2019-10-17 03:52:29 +00:00
firmwareConfig = ''
2019-10-17 03:56:15 +00:00
arm_64bit=1 # Force kernel loading system to assume a 64-bit kernel
hdmi_force_hotplug=1 # Enable headless booting
2019-10-17 03:52:29 +00:00
'';
2019-10-15 23:21:58 +00:00
};
};
};
2019-06-26 13:25:32 +00:00
# File systems configuration for using the installer's partition layout
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
2019-10-16 10:50:09 +00:00
"/var" = {
2019-10-16 23:22:38 +00:00
device = "/dev/disk/by-label/var";
2019-10-16 10:50:09 +00:00
fsType = "ext4";
};
2019-06-26 13:25:32 +00:00
};
# !!! Adding a swap file is optional, but strongly recommended!
swapDevices = [ { device = "/swapfile"; size = 1024; } ];
2019-10-15 23:21:58 +00:00
hardware = {
enableRedistributableFirmware = true; # Enable support for Pi firmware blobs
};
2019-06-26 13:25:32 +00:00
2019-10-16 01:54:23 +00:00
networking = {
enableB43Firmware = false; # If true, enable Pi wireless firmware
};
environment.systemPackages = with pkgs; [
raspberrypi-tools # Userland tools for the Raspberry Pi board
];
2019-06-26 13:25:32 +00:00
}