From afc764ba6e719479eada3436ea05e2c3c65b02b9 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Sun, 21 Aug 2022 03:09:30 +0000 Subject: [PATCH] Add new file --- nix-configs/configuration-pi4b.nix | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 nix-configs/configuration-pi4b.nix diff --git a/nix-configs/configuration-pi4b.nix b/nix-configs/configuration-pi4b.nix new file mode 100644 index 0000000..a76f661 --- /dev/null +++ b/nix-configs/configuration-pi4b.nix @@ -0,0 +1,51 @@ +{ config, pkgs, lib, ... }: + +{ + # This configuration worked on 08-20-2022 nixos-unstable + # The image used https://hydra.nixos.org/build/188033711 + + boot = { + kernelPackages = pkgs.linuxPackages_rpi4; + tmpOnTmpfs = true; + initrd.availableKernelModules = [ "usbhid" "usb_storage" ]; + # ttyAMA0 is the serial console broken out to the GPIO + kernelParams = [ + "8250.nr_uarts=1" + "console=ttyAMA0,115200" + "console=tty1" + # A lot GUI programs need this, nearly all wayland applications + "cma=128M" + ]; + }; + + boot.loader.raspberryPi = { + enable = true; + version = 4; + }; + boot.loader.grub.enable = false; + + # Required for the Wireless firmware + hardware.enableRedistributableFirmware = true; + + networking = { + hostName = "nixos-raspi-4"; # Define your hostname. + networkmanager = { + enable = true; + }; + }; + + nix = { + autoOptimiseStore = true; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + # Free up to 1GiB whenever there is less than 100MiB left. + extraOptions = '' + min-free = ${toString (100 * 1024 * 1024)} + max-free = ${toString (1024 * 1024 * 1024)} + ''; + }; + system.stateVersion = "20.09"; +}