From 0dd42efca3befa4b0dbf358f7779643d7d7991c4 Mon Sep 17 00:00:00 2001 From: Craige McWhirter Date: Wed, 16 Oct 2019 09:21:58 +1000 Subject: [PATCH] Added more Pi specific features --- Hardware/raspberry_pi_3_model_B.nix | 41 ++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/Hardware/raspberry_pi_3_model_B.nix b/Hardware/raspberry_pi_3_model_B.nix index a3a1502..271bc71 100644 --- a/Hardware/raspberry_pi_3_model_B.nix +++ b/Hardware/raspberry_pi_3_model_B.nix @@ -4,18 +4,33 @@ { - boot.initrd.availableKernelModules = [ "usbhid" "usb_storage" ]; - # 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; + boot. - # 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"]; + boot = { + initrd = { + availableKernelModules = [ + "usbhid" + "usb_storage" + ]; + }; + kernelPackages = pkgs.linuxPackages_latest; # For a Raspberry Pi 2 or 3) + kernelParams = ["cma=32M"]; # Needed for the virtual console to work on the RPi 3 + 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; + firmwareConfig = [ + "arm_64bit=1" + ]; + }; + }; + }; # File systems configuration for using the installer's partition layout fileSystems = { @@ -28,6 +43,8 @@ # !!! Adding a swap file is optional, but strongly recommended! swapDevices = [ { device = "/swapfile"; size = 1024; } ]; - hardware.enableRedistributableFirmware = true; # Enable support for Pi firmware blobs + hardware = { + enableRedistributableFirmware = true; # Enable support for Pi firmware blobs + }; }