nixos-generators icon indicating copy to clipboard operation
nixos-generators copied to clipboard

sd-aarch64 doesn't work for Raspberry Pi 4

Open willghatch opened this issue 3 years ago • 1 comments

The sd-aarch64-installer format just references the nix installer which works generically for Raspberry Pi 3 and 4. However, the sd-aarch64 (no -installer) only supports the Raspberry Pi 3.

willghatch avatar Jul 15 '22 16:07 willghatch

tl;dr Seems like sd-aarch64-installer is not an installer image (anymore) but a no-installer image (now)

I took a look into this issue and found that it goes a little bit deeper:

  1. The installer/no-installer split for the aarch64 formats happened in 2019: https://github.com/nix-community/nixos-generators/pull/25
  • Note that it still references installer/cd-dvd/sd-image-aarch64.nix (emphasis on cd-dvd in nixpkgs
  1. Sometime before 2021-02 the installer modules were moved in nixpkgs to installer/sd-card/sd-image-aarch64.nix
  2. In 2021-02 a PR in nixpkgs split the original installer image to make it more modular: https://github.com/NixOS/nixpkgs/commit/3c744bf68d0dbfbe18f9b0d5487b843f29ed47c1
  1. In 2021-10 probably it was noticed in this repo that the sd-aarch64 image changed its location in nixpkgs: https://github.com/nix-community/nixos-generators/commit/5d39e9b4d3608b346e03a346601825cdcd556b74
  • Unfortunately the "API" of the image changed too and that was missed (whether the installer/*.nix modules are considered a public "API" I don't know). Since then the sd-aarch64-installer format doesn't seem to build an installer image anymore (Bear with me, I haven't tried. I could have missed something).

A potential fix for this would be to adjust the sd-aarch64 & sd-aarch64-installer formats accordingly in this repo. The sd-aarch64 format could probably be simplified. The downside is that if someone figured the same things out in the meantime when using this repo (and not opening an issue), the API of nixos-generators would break for them. Could be a bit of a tricky API migration :confused: (I haven't checked how this repo is released/versioned)

mindsbackyard avatar Dec 27 '22 15:12 mindsbackyard