NixOS support for CM4

I always wanted to run NixOS on my uConsole, even before it arrived. Now that I finally have it my hands, I’ve spent a lot of time reading, and trying stuff out. Based on different threads here and some github repos, I was able to come up with a basic NixOS configuration to build a base SD card image.

I can’t say it’s a success story: the system boots, but the built-in display doesn’t work, so the boot had to be confirmed over HDMI. Then it is impossible to log in since the keyboard doesn’t work (even USB keyboards aren’t).

I’ll keep tweaking it, but if anyone is interested and wants to try it out or help, the code is available at:


I’m doing the same with kali linux
Although I’m not expert in linux but these files might help

Also how did you manage to config an image?
Secondly did you manage to l
Patch it with the above files?

I guess the “how” is very NixOS specific, but I got lots of ideas and some patches from

then, there’s this for inspiration as well:

Will have to give these a look through plus im happy to try a new os and mess about with it, ill let you know if i manage to figure anything out.

This isn’t the most helpful for NixOS but It’s a much more comprehensive guide, and explanation of how to patch the kernel with the DTO’s needed for the screen, keyboard, ect than clockworks, or other guides

1 Like

I am interested in this as well. it seems like someone has had some success adding support for the A06 version to NixOS. Would like to see the same for the CM4. NixOS on ARM/Clockworkpi A06 uConsole - NixOS Wiki

Actually yesterday I was able to sort out the display, the keyboard, etc. I just had to apply the device tree overlays properly, the NixOS way… Since I was able to log in using the keyboard, I also verified that the wifi is not working, so that’s the next. The config is available in the repo from the first post.

This is very exiting. I hope once major bugs are squashed, we could have an image that we could just flash, for the plebs like myself…

Current state:

Wifi works, bluetooth doesn’t. I’ll need to clean up the code then I’ll push the latest changes into the repo, probably early next week.


So I pushed the code, it’s a bit messy, but I expect it to change (that’s why I am keeping lots of commented out stuff around). Basically I am using PotatoMania’s kernel patches, and the offical device tree overlays. Bluetooth doesn’t work, and wifi is slow, but as you can see I managed to install Gnome, etc.