NixOS on Xilinx Zynq and ZynqMP

Hi guys, I somehow managed to port NixOS to the Xilinx FPGA+ARM SoCs. The attempt starts when I was fiddling around with PetaLinux, and I kind of felt that Yocto is suboptimal for such a task:

  • Yocto doesn’t provide elegant way to organize your configurations; you need to hop between multiple directories even for the simplest configuration task.
  • Yocto doesn’t maintain build idempocy; sometimes you need to clean all the build artifacts using petalinux-build -x mrproper.
  • While NixOS may not be an operating system specifically designed for embedded, Zynq isn’t that resource constrained.

I wondered how it would be like if I was able to port NixOS to it, and here we are.

17 Likes

Thanks for your research! I also had this device last year, but it was taken back by the teacher at the end of last semester :frowning:

You can merge your code into this project if you are willing to:

And write setup guidelines here:
https://nixos.wiki/wiki/NixOS_on_ARM

I appreciate your suggestion. That was actually my initial goal. If you take a closer look, you’ll notice that many designs, such as the xlnx-firmware-update command, are borrowed from nixos-hardware. However, at some point it expanded beyond containing just packages necessary for NixOS boot. It now also includes a few packages useful for Xilinx development. These packages may be too niche for upstreaming to Nixpkgs, but definitely relevant when making stuffs with Zynq. I find it more organized to keep it the current form.

1 Like

Amazing, I will try that when doing the next project with a Zynq. I remember lots of issues with PetaLinux that you mentioned and replacing that with a declarative config seems great if it works.

2 Likes