~xdefrag/nixos-rpi

NixOS Raspberry Pi configs.
Fix makefile
Add minimum.nix
Add makefile

refs

senpai
browse  log 

clone

read-only
https://git.sr.ht/~xdefrag/nixos-rpi
read/write
git@git.sr.ht:~xdefrag/nixos-rpi

You can also use your local clone with git send-email.

#NixOS Raspberry Pi

Currently (Oct 2020) on Raspberry Pi 3B+ I'm achieved to run NixOS 20.03 with 4.19 kernel. Bluetooth not working, wireless... Well, it's Broadcom. But overall it's somewhat suit my needs and I'm happy with that.

#How

Install nixos-generators:

# configuration.nix
{
  boot.binfmt.emulatedSystems = [ "aarch64-linux" ];

  environment.systemPackages = with pkgs; [
    nixos-generators
  ];
}

Create minimal nixos config:

# rpi-minimum.nix
{ pkgs, ... }:

{
  imports = [
    <nixpkgs/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix>
  ];

  boot.kernelPackages = pkgs.linuxPackages_4_19;
}

Build image:

$ nixos-generate -f sd-aarch64 --system aarch64-linux -c rpi-minimum.nix

Write it to SD Card:

$ zstdcat nixos-sd-image...img.zst | doas dd bs=1M iflag=fullblock of=/dev/sdb status=progress

Put it to Raspberry Pi, turn on and it must boot and take you to shell prompt. Attach new user with authorized key if you want run it headless.

#References