Skip to content

Instantly share code, notes, and snippets.

@cpcloud
Last active May 30, 2021 19:25
Show Gist options
  • Save cpcloud/b516860b341eb6ba686ce6de6dc20ec2 to your computer and use it in GitHub Desktop.
Save cpcloud/b516860b341eb6ba686ce6de6dc20ec2 to your computer and use it in GitHub Desktop.
rpi4 templtae
{ pkgs, ... }:
let
hardwareUrl = "https://github.com/NixOS/nixos-hardware/archive/684ae160a6e76590eafa3fca8061b6ad57bcc9ad.tar.gz";
in
{
imports = [
"${fetchTarball hardwareUrl}/raspberry-pi/4"
];
boot = {
tmpOnTmpfs = true;
initrd.availableKernelModules = [ "usbhid" "usb_storage" "vc4" ];
# kernelParams = [
# "8250.nr_uarts=1"
# "console=ttyAMA0,115200"
# "console=tty1"
# "cma=128M"
# ];
# loader = {
# raspberryPi = {
# enable = true;
# version = 4;
# };
# };
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS";
fsType = "ext4";
};
};
networking = {
hostName = "plover";
};
time.timeZone = "America/New_York";
environment.systemPackages = with pkgs; [
neovim
libraspberrypi
raspberrypi-eeprom
gitAndTools.git
gitAndTools.gh
];
services.openssh.enable = true;
users = {
users.cloud = {
isNormalUser = true;
createHome = true;
extraGroups = [ "wheel" ];
};
};
nix = {
trustedUsers = [ "@wheel" ];
autoOptimiseStore = true;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# Free up to 1GiB whenever there is less than 100MiB left.
extraOptions =
let
kb = 1024;
mb = kb * kb;
in
''
min-free = ${toString (100 * mb)}
max-free = ${toString (1024 * mb)}
'';
};
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
hardware.raspberry-pi."4".fkms-3d.enable = true;
system.stateVersion = "21.11";
}
@cpcloud
Copy link
Author

cpcloud commented May 30, 2021

Link to raw content https://tinyurl.com/urmmcpw9

@cpcloud
Copy link
Author

cpcloud commented May 30, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment