From 25db8bedfab9764e76c126733bc575c0a74ce0ad Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Thu, 14 Oct 2021 10:43:26 -0400 Subject: [PATCH] feat: add Raspberry Pi configuraation --- hosts/Infini-RPI/default.nix | 13 +++++++++++++ profiles/hardware/rpi.nix | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 hosts/Infini-RPI/default.nix create mode 100644 profiles/hardware/rpi.nix diff --git a/hosts/Infini-RPI/default.nix b/hosts/Infini-RPI/default.nix new file mode 100644 index 0000000..63cd7ca --- /dev/null +++ b/hosts/Infini-RPI/default.nix @@ -0,0 +1,13 @@ +{ suites, profiles, pkgs, lib, ... }: { + imports = lib.lists.flatten [ + (with suites; [ + base + ]) + + (with profiles; [ + hardware.rpi + + networking.wireless + ]) + ]; +} diff --git a/profiles/hardware/rpi.nix b/profiles/hardware/rpi.nix new file mode 100644 index 0000000..3723c1f --- /dev/null +++ b/profiles/hardware/rpi.nix @@ -0,0 +1,32 @@ +{ config, pkgs, lib, inputs, ... }: { + imports = [ inputs.nixos-hardware.outputs.nixosModules.raspberry-pi-4 ]; + + boot = { + tmpOnTmpfs = true; + kernelParams = [ + "8250.nr_uarts=1" + "console=ttyAMA0,115200" + "console=tty1" + ]; + + loader = { + raspberryPi = { + enable = true; + version = 4; + }; + + grub.enable = false; + generic-extlinux-compatible.enable = true; + }; + }; + + hardware.raspberry-pi."4" = { + fkms-3d.enable = true; + }; + + powerManagement.cpuFreqGovernor = "ondemand"; + + environment.systemPackages = with pkgs; [ + raspberrypi-eeprom + ]; +}