From b72c683304795967bb040e8888cebb080509df5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Tue, 11 May 2021 09:32:03 +0200 Subject: [PATCH] Add Rpi4 --- README.md | 1 + flake.nix | 1 + raspberry-pi/4/default.nix | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 raspberry-pi/4/default.nix diff --git a/README.md b/README.md index 2dab83c..35c4ef2 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ See code for all available configurations. | [MSI GS60 2QE][] | `` | | PC Engines APU | `` | | [Raspberry Pi 2][] | `` | +| [Raspberry Pi 4][] | `` | | [Samsung Series 9 NP900X3C][] | `` | | [Purism Librem 13v3][] | `` | | [Purism Librem 15v3][] | `` | diff --git a/flake.nix b/flake.nix index 570f0d2..0a16ed1 100644 --- a/flake.nix +++ b/flake.nix @@ -73,6 +73,7 @@ microsoft-surface-pro-3 = import ./microsoft/surface-pro/3; pcengines-apu = import ./pcengines/apu; raspberry-pi-2 = import ./raspberry-pi/2; + raspberry-pi-4 = import ./raspberry-pi/4; samsung-np900x3c = import ./samsung/np900x3c; system76 = import ./system76; system76-darp6 = import ./system76/darp6; diff --git a/raspberry-pi/4/default.nix b/raspberry-pi/4/default.nix new file mode 100644 index 0000000..b43e988 --- /dev/null +++ b/raspberry-pi/4/default.nix @@ -0,0 +1,30 @@ +{ lib, pkgs, ...}: + +{ + boot = { + kernelPackages = lib.mkDefault pkgs.linuxPackages_rpi4; + initrd.availableKernelModules = [ "usbhid" "usb_storage" "vc4" ]; + + # Needed for 4K displays + kernelParams = [ "cma=128M" ]; + + loader = { + raspberryPi = { + enable = true; + version = 4; + firmwareConfig = '' + dtparam=audio=on + gpu_mem=192 + ''; + }; + grub.enable = false; + generic-extlinux-compatible.enable = true; + }; + }; + + nix.buildCores = 4; + + # Required for the Wireless firmware + hardware.enableRedistributableFirmware = true; + +} \ No newline at end of file