From ae514940617df7ed5ccf681e541d1e328b25746d Mon Sep 17 00:00:00 2001 From: James Andariese Date: Sat, 3 May 2025 15:49:34 -0500 Subject: [PATCH] rpi4/chimchar wip --- flake.nix | 2 +- hosts/chimchar.nix | 35 +++++++++++++++++++++++++++++++++++ types/rpi4.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 hosts/chimchar.nix create mode 100644 types/rpi4.nix diff --git a/flake.nix b/flake.nix index 64cddc3..4a2767f 100644 --- a/flake.nix +++ b/flake.nix @@ -66,6 +66,6 @@ };}; }; } ( [] # lists to recursively merge into the config. - ++ (map (h: buildMachine h "x86_64-linux") hosts) + ++ (map (h: buildMachine h "aarch64-linux") hosts) ); } diff --git a/hosts/chimchar.nix b/hosts/chimchar.nix new file mode 100644 index 0000000..9b8c9b8 --- /dev/null +++ b/hosts/chimchar.nix @@ -0,0 +1,35 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, lib, inputs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ../types/rpi4.nix + ]; + config = { + networking = { + hostName = "chimchar"; + wireless = { + enable = true; + networks."STRUDEL7".psk = "1floopydroober"; + interfaces = [ "wlan0" ]; + }; + }; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + options = [ "noatime" ]; + }; + + swapDevices = [ ]; + + services.xserver.enable = true; + services.xserver.displayManager.lightdm.enable = true; + services.xserver.windowManager.fvwm3.enable = true; + networking.useDHCP = lib.mkDefault true; + }; +} diff --git a/types/rpi4.nix b/types/rpi4.nix new file mode 100644 index 0000000..c23a173 --- /dev/null +++ b/types/rpi4.nix @@ -0,0 +1,42 @@ +{ config, pkgs, lib, flake-inputs, ... }: + +{ + imports = [ + ../modules/session.nix + ../modules/users.nix + ../modules/serial-console.nix + ../modules/pragmatic-bin.nix + ]; + + hardware.enableRedistributableFirmware = true; + boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.kernelPackages = pkgs.linuxKernel.packages.linux_rpi4; + boot.extraModulePackages = [ ]; + boot.loader = { + grub.enable = false; + generic-extlinux-compatible.enable = lib.mkForce true; + }; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; + + services.openssh.enable = true; + networking.firewall.enable = false; + + environment.systemPackages = with pkgs; [ + neovim + htop + ]; + + systemd.network.wait-online.enable = lib.mkDefault false; + + security.sudo = { + enable = true; + extraRules = [ + { users = [ "%wheel" ]; + commands = [ { command = "ALL"; options = [ "NOPASSWD" ]; } ]; + } + ]; + }; +}