Raspberrypi 3b nixos 24.05

Hi!

I have the following configuration for the boot config / custom hardware setup for my raspberry-pi 3b nixos installation:

{pkgs, ...}: {
  nixpkgs.system = "aarch64-linux";

  environment.systemPackages = [pkgs.libraspberrypi];

  boot = {
    kernelParams = ["cma=256M"];

    loader = {
      grub.enable = false;
      generic-extlinux-compatible.enable = false;

      raspberryPi = {
        enable = true;
        version = 3;

        uboot.enable = true;

        firmwareConfig = ''
          core_freq=250
          gpu_mem=256
        '';
      };
    };
  };

  swapDevices = [{device = "/dev/disk/by-label/swap";}];

  powerManagement.cpuFreqGovernor = "ondemand";

  services.udev.extraRules = ''
    SUBSYSTEM=="vchiq", GROUP="video", MODE="0660"
  '';
}

since my last upgrade of nixpkgs I have a warning saying

trace: warning: The option set for `boot.loader.raspberrypi` has been recommended against
for years, and is now formally deprecated.

It is possible it already did not work like you expected.

It never worked on the Raspberry Pi 4 family.

These options will be removed by NixOS 24.11.

I’m using the following project for my raspberry-4b configurations, and I was pleased to see that there is even a raspberrypi-3 PR, but it got closed and by looking at it its mainly doing the same thing that triggers the warning.

I am not sure how to configure the boot section correcly, I guess I could just do something like

  boot = {
    kernelParams = ["cma=256M"];
    loader = {
      grub.enable = false;
      generic-extlinux-compatible.enable = true;
    }
  };

but Im wondering if this is the expected way / better way to fix the warning? Is there an optimal nixos hardware configuration for raspberrypi that is not using the deprecated options ? If so is there a reason why such configuration could not end up in the project mentioned above ?

Thank you for your help

I’ve not yet upgraded to 23.05, but my Pi 3B is using generic-extlinux-compatible just fine. I’m not using nixos-hardware for it (but I use that project for a 4b I have). I’m not using much hardware with it, but bluetooth and wifi seem to work without extra dependencies. /dev/gpiomem doesn’t exist, probably because I’m using the default nixos kernel instead of the rpi kernel.

You’re correct that this approach doesn’t declaratively configure my config.txt in my nix config; in my case I’m creating a whole SD image (to facilitate BTRFS root), so I append some desired values during the creation of the SD image.

Hope this answers some of your questions.