Any experience with NixOS on MNT Reform?

Anybody who got NixOS running? Any problems one should expect when trying to?

1 Like

Yes, NixOS is working, and most packages are precompiled for aarch64. If you manage to install the Nix tools onto the Debian image then you can build and installer image, see nix-community/hardware-mnt-reform.

6 Likes

I’ve got NixOS running on my MNT Reform right now. Since the original project seems dead, given the unaddressed pull request from March and the fact that Discourse says emery hasn’t logged in since July 2021, I went ahead and forked it: lykso/hardware-mnt-reform - hardware-mnt-reform - Codeberg.org

I still want to rewrite the README to make it a little clearer, but as of now you should be able to get NixOS 23.05 running with Linux kernel 6.1.59 and the 2023-10-18 uboot revision from MNT’s repository by following those instructions with very little need for improvisation. (I.e., some of the commands have to be run as root or they won’t work, and I remember having to use the --extra-experimental-features "nix-command flakes" flag with nix a few times as well.)

This fork does not support modules other than the i.MX8MQ, and maybe the i.MX8MP, as far as I can tell. Adding support for other modules ought to be fairly simple, though. In theory it should be simply a matter of getting their kernel configs and device trees in place. My fork currently uses an old version of the kernel config that I think will only work with the i.MX8MQ and maybe the i.MX8MP (I don’t have a Reform Pocket to test it with).

Finally, it builds the kernel from source, which takes at least 6 hours on my machine. Plan accordingly.

Edit: Audio works now, but the README still needs a rewrite.

5 Likes

I’m very interested by a NixOS image for my Reform.
@lykso I tried to build one from your repo, but I got interrupted at the vmlinuz step, the makefile couldn’t find the dtb. I’ll retry later with a swapfile to see if performance can be helped during the build process.

Yeah, it took me a 12GB swap file to get past that error, IIRC.

1 Like

I got the SD card to work :yum:

Do you have any particular advice to boot an encrypted nvme partition from a SD card? I want to boot other partitions without toggling the dipswitch everytime I want to boot something else :face_with_hand_over_mouth:

The DIP switch of the imx8mq only chooses where u-boot is loaded from.

But irrespective, whether u-boot is loaded from emmc or sd-card, the default boot order is baked into the u-boot binary remains the same.

I wrote some notes on the boot process down here:

The way that Debian boots a system on encrypted nvme, is to load an initramfs which then knows how to decrypt and boot nvme. The initramfs is loaded by u-boot from the first partition of the sd-card (tried first) or from emmc (tried second). The reform-boundary-uboot fork provided by MNT does not have support for loading data from nvme. There are efforts to rebase the necessary patches for imx8mq to upstream u-boot and I think upstream u-boot should be able to access nvme but I might misremember this and you should ask those working on that about details. One possible contact would be bluerise in the reform irc channel.

1 Like

Ah I see: if I toggle it on, it will look for /boot/extlinux/extlinux.conf on the eemc, and if I insert my 9front SD Card, it will find the /boot.scr first and go from there.

Thanks for the doc josch!

EDIT: Worked as I expected it to work. I’ll try the NixOS install later and report back if i run into issues. btw @lykso are you on IRC?
EDIT: Install went good, I’m very thankful for your work :saluting_face:

1 Like