[Nix-dev] Raspberry-Pi NixOS

Tomas Hlavaty tom at logand.com
Wed Jul 13 22:19:05 CEST 2016


Hi Anders,

Anders Lundstedt <anders at anderslundstedt.se> writes:
> Has anyone successfully installed NixOS on a Raspberry Pi 3?

I am running nixos-version 16.09.git.a5559f5 (Flounder).

I have rpi2 running nixos which I installed as described in the wiki and
then managed to upgrade in a few steps up to the nixos-version
16.09.git.8376694M (Emu).  It runs hydra <http://rlszasz6dlv5cxrr.onion>
which is kind of blocking me from upgrading further without spending too
much time on it.

Then I cloned this rpi2 sd card and copied into /boot files from the
boot directory in <https://github.com/raspberrypi/firmware>.  With the
new /boot and old / from rpi2, rpi3 boots and works fine.

So far I need to copy the /boot data manually after each nixos-rebuild
switch.

Now I'd like to port nixpkgs for rpi3 so that nixos-rebuild switch
generates correct /boot data.  Unfortunatelly, I don't know how to do it
(yet?) and nixos-rebuild build-vm has been running for a second day so
the progress is very slow.

> On Fri, Jun 17, 2016 at 9:35 AM, Tuomas Tynkkynen
> <tuomas.tynkkynen at iki.fi> wrote:
>> Though the ARMv7 image listed there doesn't have the necessary RPi bootloader
>> things added - that's not hard to add but I don't have a board to test with.
>
> How do I add the "bootloader things"? I do not know much about these
> things but I have a Raspberry Pi 3 and with some further instructions
> and/or pointers I think I could give it a try.

My guess:

- pkgs/os-specific/linux/firmware/raspberrypi/default.nix needs newer
  rev as the current one is pre-rpi3.

- pkgs/os-specific/linux/kernel/linux-rpi.nix needs newer kernel,
  probably for the same reason as above.  I tried 4.4.13-v7.

The above changes did compile but rpi3 did not boot.

I still need to change boot.* in /etc/nixos/configuration.nix but i have
no idea how.  We need something like rpi2.nix in
<https://github.com/nixos/nixos-hardware.git> but for rpi3.  I have no
idea how the guys came up with that stuff, e.g. boot.kernelParams or
what should happen with boot.loader.raspberryPi.version for example.

One more thing.  As I already have hydra on rpi2, I should add a job to
build armv7l image to make it easier for people to bootstrap the latest
nixos.  What nixpkgs attribute will do that?  Does somebody know?  At
least generating the rootfs would be a good start.

Hope it helps.  Please let us know if you move it forward.

Tomas


More information about the nix-dev mailing list