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
|
2019-10-15 00:12:22 +02:00
|
|
|
boot.kernelParams = ["cma=32M"];
|
2019-10-11 19:14:18 +02:00
|
|
|
boot.loader.raspberryPi.enable = true;
|
|
|
|
boot.loader.raspberryPi.version = 3;
|
|
|
|
boot.loader.raspberryPi.uboot.enable = true;
|
|
|
|
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-15 00:18:57 +02:00
|
|
|
services.openssh.permitRootLogin = "yes";
|
|
|
|
|
|
|
|
# Cleanup tmp on startup
|
|
|
|
boot.cleanTmpDir = true;
|
|
|
|
|
|
|
|
# Set hostname
|
|
|
|
networking.hostName = "zion";
|
2019-10-11 14:26:37 +02:00
|
|
|
}
|