From 8d3737a178ff9a10c87b732c99d3deee0eeabb55 Mon Sep 17 00:00:00 2001 From: Craige McWhirter Date: Wed, 26 Jun 2019 23:25:32 +1000 Subject: [PATCH] Initial commit --- hardware/raspberry_pi_3_model_B.nix | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 hardware/raspberry_pi_3_model_B.nix diff --git a/hardware/raspberry_pi_3_model_B.nix b/hardware/raspberry_pi_3_model_B.nix new file mode 100644 index 0000000..b5d2247 --- /dev/null +++ b/hardware/raspberry_pi_3_model_B.nix @@ -0,0 +1,31 @@ +# Configuration common to all Raspberry Pi 3 Model B devices + +{ 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; + + # For a Raspberry Pi 2 or 3): + boot.kernelPackages = pkgs.linuxPackages_latest; + + # !!! Needed for the virtual console to work on the RPi 3, as the default of 16M doesn't seem to be enough. + # If X.org behaves weirdly (I only saw the cursor) then try increasing this to 256M. + boot.kernelParams = ["cma=32M"]; + + # File systems configuration for using the installer's partition layout + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + 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 + +}