From 5220ab42395ff1db8205c3c4cca193dbec4d0c96 Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 11 Oct 2019 19:14:18 +0200 Subject: [PATCH] Enable ssh on boot and RP3 tweaks --- configuration.nix | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/configuration.nix b/configuration.nix index 3827763..90757d1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,15 +4,22 @@ 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; - - # !!! 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. - # On a Raspberry Pi 4 with 4 GB, you should either disable this parameter or increase to at least 64M if you want the USB ports to work. - boot.kernelParams = ["cma=32M"]; - + + # 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" = { @@ -24,7 +31,10 @@ fsType = "ext4"; }; }; - + # !!! Adding a swap file is optional, but strongly recommended! swapDevices = [ { device = "/swapfile"; size = 1024; } ]; + + # Configure basic SSH access + services.openssh.enable = true; }