Skip to content

Instantly share code, notes, and snippets.

@mtlynch
Created June 18, 2023 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtlynch/51bc288b8f91ec601dd9163aedda5a05 to your computer and use it in GitHub Desktop.
Save mtlynch/51bc288b8f91ec601dd9163aedda5a05 to your computer and use it in GitHub Desktop.
{ config, pkgs, lib, ... }:
let
user = "guest";
password = "guest";
SSID = "mywifi";
SSIDpassword = "mypassword";
interface = "wlan0";
hostname = "myhostname";
nixosHardwareVersion = "1bc731fde4af337134331572889de8dd8dbff897";
in {
imports = ["${fetchTarball "https://github.com/NixOS/nixos-hardware/archive/${nixosHardwareVersion}.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;
services.xserver = {
enable = true;
displayManager.lightdm.enable = true;
desktopManager.xfce.enable = true;
};
hardware.pulseaudio.enable = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment