2019-10-11 14:26:37 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
# NixOS wants to enable GRUB by default
|
|
|
|
boot.loader.grub.enable = false;
|
|
|
|
# Enables the generation of /boot/extlinux/extlinux.conf
|
|
|
|
boot.loader.generic-extlinux-compatible.enable = true;
|
2019-10-11 19:14:18 +02:00
|
|
|
|
2019-10-11 14:26:37 +02:00
|
|
|
# !!! Otherwise (even if you have a Raspberry Pi 2 or 3), pick this:
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
2019-10-11 19:14:18 +02:00
|
|
|
|
|
|
|
# A bunch of boot parameters needed for optimal runtime on RPi 3B
|
|
|
|
boot.kernelParams = ["cma=256M"];
|
|
|
|
boot.loader.raspberryPi.enable = true;
|
|
|
|
boot.loader.raspberryPi.version = 3;
|
|
|
|
boot.loader.raspberryPi.uboot.enable = true;
|
|
|
|
boot.loader.raspberryPi.firmwareConfig = ''
|
|
|
|
gpu_mem=256
|
|
|
|
'';
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
raspberrypi-tools
|
|
|
|
];
|
|
|
|
|
2019-10-11 14:26:37 +02:00
|
|
|
# File systems configuration for using the installer's partition layout
|
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "/dev/disk/by-label/NIXOS_SD";
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
};
|
2019-10-11 19:14:18 +02:00
|
|
|
|
2019-10-11 14:26:37 +02:00
|
|
|
# !!! Adding a swap file is optional, but strongly recommended!
|
|
|
|
swapDevices = [ { device = "/swapfile"; size = 1024; } ];
|
2019-10-11 19:14:18 +02:00
|
|
|
|
|
|
|
# Configure basic SSH access
|
|
|
|
services.openssh.enable = true;
|
2019-10-11 14:26:37 +02:00
|
|
|
}
|