From c5958d69b37b3b9fc7869fe3c326c7d5c060c3a3 Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Sat, 19 Jun 2021 08:03:53 -0400 Subject: [PATCH] Update raspberry hardware config --- hosts/raspberry/configuration.nix | 24 ++++++++++++++++- hosts/raspberry/hardware.nix | 43 ++++++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/hosts/raspberry/configuration.nix b/hosts/raspberry/configuration.nix index 0c6f771..8b45b91 100644 --- a/hosts/raspberry/configuration.nix +++ b/hosts/raspberry/configuration.nix @@ -1,3 +1,25 @@ # This file is controlled by /etc/dotfiles/README.org -{ # TODO +{ config, pkgs, ... }: + +{ + networking.hostName = "raspberry"; + networking.firewall.enable = false; + networking.wireless.enable = true; + networking.wireless.userControlled.enable = true; + + + + environment.systemPackages = [ + pkgs.libraspberrypi + pkgs.raspberrypi-eeprom + ]; + + programs.fish.enable = true; + programs.gnupg.agent.enable = true; + + users.users.chris = { + shell = pkgs.fish; + isnormaluser = true; + extragroups = [ "wheel" ]; + }; } diff --git a/hosts/raspberry/hardware.nix b/hosts/raspberry/hardware.nix index 0c6f771..95cad33 100644 --- a/hosts/raspberry/hardware.nix +++ b/hosts/raspberry/hardware.nix @@ -1,3 +1,44 @@ # This file is controlled by /etc/dotfiles/README.org -{ # TODO +{ config, pkgs, lib, inputs, ... }: + +{ + imports = [ + inputs.nixos-hardware.nixosModules.raspberry-pi.4 + ]; + + boot.kernelPackages = pkgs.linuxPackages_rpi4; + boot.tmpOnTmpfs = true; + boot.initrd.availableKernelModules = [ "usbhid" "usb_storage" ]; + boot.kernelParams = [ + "8250.nr_uarts=1" + "console=ttyAMA0,115200" + "console=tty1" + "cma=128M" + ]; + + boot.loader.grub.enable = false; + boot.loader.generic-extlinux-compatible.enable = true; + boot.loader.raspberryPi = { + enable = true; + version = 4; + firmwareConfig = '' + dtparam=sd_poll_once=on + dtparam=audio=on + ''; + }; + + sound.enable = true; + hardware.pulseaudio.enable = true; + hardware.enableRedistributableFirmware = true; + hardware.raspberry-pi."4".fkms-3d.enable = true; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + options = [ "noatime" ]; + }; + }; + + powerManagement.cpuFreqGovernor = "ondemand"; }