Skip to content

Instantly share code, notes, and snippets.

@SCOTT-HAMILTON
Created July 19, 2021 14:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SCOTT-HAMILTON/b4bd3eee0c2ae85e8ff91c702e59dab7 to your computer and use it in GitHub Desktop.
Save SCOTT-HAMILTON/b4bd3eee0c2ae85e8ff91c702e59dab7 to your computer and use it in GitHub Desktop.
{ config, pkgs, lib, ... }:
let
user = "nixos";
password = "nixos";
SSID = "MyBox";
SSIDpassword = "...";
interface = "wlan0";
hostname = "MyPi";
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 = hostname;
wireless = {
enable = true;
networks."${SSID}".psk = SSIDpassword;
interfaces = [ interface ];
};
};
environment.systemPackages = with pkgs; [ vim ];
services.openssh.enable = true;
users = {
mutableUsers = false;
users."${user}" = {
isNormalUser = true;
password = password;
extraGroups = [ "wheel" ];
};
};
# Enable GPU acceleration
hardware.raspberry-pi."4".fkms-3d.enable = true;
hardware.enableRedistributableFirmware = true;
hardware.pulseaudio.enable = true;
sound.enable = true;
boot.loader.raspberryPi.firmwareConfig = ''
dtparam=audio=on
'';
boot.kernelParams = [
"console=ttyS1,115200n8"
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment