From f719eb4aa830d8ff43ace8e6507b32c7148e788c Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Sun, 21 Aug 2022 03:38:49 +0000 Subject: [PATCH] Update configuration-pi4b.nix --- nix-configs/configuration-pi4b.nix | 51 --------------------------- nix-configs/rpi4.nix | 56 ++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 51 deletions(-) delete mode 100644 nix-configs/configuration-pi4b.nix create mode 100644 nix-configs/rpi4.nix diff --git a/nix-configs/configuration-pi4b.nix b/nix-configs/configuration-pi4b.nix deleted file mode 100644 index 141f278..0000000 --- a/nix-configs/configuration-pi4b.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ 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 = "22.11"; -} diff --git a/nix-configs/rpi4.nix b/nix-configs/rpi4.nix new file mode 100644 index 0000000..1903f87 --- /dev/null +++ b/nix-configs/rpi4.nix @@ -0,0 +1,56 @@ +{ config, pkgs, lib, ... }: + +let + SSID = "Honeycutt-5G"; + SSIDpassword = "Frappe92"; + interface = "wlan0"; + hostname = "NixOS"; +in { + imports = ["${fetchTarball "https://github.com/NixOS/nixos-hardware/archive/936e4649098d6a5e0762058cb7687be1b2d90550.tar.gz" }/raspberry-pi/4"]; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + options = [ "noatime" ]; + }; + }; + + networking = { + hostName = "NixOS"; + networkmanager.enable = true; + + wireless = { + enable = true; + networks."${SSID}".psk = SSIDpassword; + interfaces = [ interface ]; + }; + }; + + # Set your time zone. + time.timeZone = "America/Denver"; + + environment.systemPackages = with pkgs; [ vim ]; + + services.openssh.enable = true; + + # Define user accounts + users.extraUsers.aaronh = { + description = "Aaron Honeycutt"; + home = "/home/aaronh"; + extraGroups = [ "wheel" "networkmanager" "adm"]; + isNormalUser = true; + hashedPassword = "$6$aAcbLtqiqzySifls$jdKMOQjoWITHD/dWNNZVUH/qNc6aoJ7v4zYofi0U7IJSVTbmOfChS3mzaJbp57AodjdPNKPrnrip8Nlh2Qanx."; + }; + + # Enable GPU acceleration + hardware.raspberry-pi."4".fkms-3d.enable = true; + + services.xserver = { + enable = true; + displayManager.lightdm.enable = true; + desktopManager.xfce.enable = true; + }; + + hardware.pulseaudio.enable = true; +}