41 lines
1.2 KiB
Nix
41 lines
1.2 KiB
Nix
{ 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;
|
|
|
|
# !!! Otherwise (even if you have a Raspberry Pi 2 or 3), pick this:
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
# 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
|
|
];
|
|
|
|
# File systems configuration for using the installer's partition layout
|
|
fileSystems = {
|
|
"/boot" = {
|
|
device = "/dev/disk/by-label/NIXOS_BOOT";
|
|
fsType = "vfat";
|
|
};
|
|
"/" = {
|
|
device = "/dev/disk/by-label/NIXOS_SD";
|
|
fsType = "ext4";
|
|
};
|
|
};
|
|
|
|
# !!! Adding a swap file is optional, but strongly recommended!
|
|
swapDevices = [ { device = "/swapfile"; size = 1024; } ];
|
|
|
|
# Configure basic SSH access
|
|
services.openssh.enable = true;
|
|
}
|