NixOS on ARM/Raspberry Pi: Difference between revisions

imported>Samueldr
mNo edit summary
imported>Endgame
Firmware is provided via enableRedistributableFirmware in nixpkgs; see pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix
Line 98: Line 98:
The ARMv7 image should boot out-of-the-box, though the author hasn't personally tested this.
The ARMv7 image should boot out-of-the-box, though the author hasn't personally tested this.


=== Raspberry Pi 3 ===
=== Raspberry Pi 3 / 3B+ ===


Both the AArch64 and ARMv7 images boot out-of-the-box. Using the 64-bit AArch64 image is highly recommended, as the availability of binaries is much better and allows the use of the 64-bit instruction set.
Both the AArch64 and ARMv7 images boot out-of-the-box. Using the 64-bit AArch64 image is highly recommended, as the availability of binaries is much better and allows the use of the 64-bit instruction set.
Line 113: Line 113:
<syntaxhighlight lang=nix>
<syntaxhighlight lang=nix>
{
{
  ...
   hardware.enableRedistributableFirmware = true;
   hardware.enableRedistributableFirmware = true;
  networking.wireless.enable = true;
}
</syntaxhighlight>
=== Raspberry Pi 3B+ ===
Here is a similar incantation as above, but for the Raspberry Pi 3B+:
<syntaxhighlight lang=nix>
{
  ...
  hardware.enableRedistributableFirmware = true;
  hardware.firmware = [
    (pkgs.stdenv.mkDerivation {
    name = "broadcom-rpi3bplus-extra";
    src = pkgs.fetchurl {
    url = "https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/b518de4/brcm/brcmfmac43455-sdio.txt";
    sha256 = "0r4bvwkm3fx60bbpwd83zbjganjnffiq1jkaj0h20bwdj9ysawg9";
    };
    phases = [ "installPhase" ];
    installPhase = ''
    mkdir -p $out/lib/firmware/brcm
    cp $src $out/lib/firmware/brcm/brcmfmac43455-sdio.txt
    '';
    })
  ];
   networking.wireless.enable = true;
   networking.wireless.enable = true;
}
}