Skip to content

Alec's Journal


NixOS + handheld emulation

An extremely versatile handheld system replacement!

April 2nd, 2026

Read time: 6 minutes


A while back I wrote about how I managed to get NixOS running on an Anbernic RG35XX H handheld console. Since then, I've wanted to make it usable so I could play & emulate games. With the help of my friend Claude, I've managed to build a working Nix flake for the device.

What I got working now

Previously, the Nix builds only worked when the Nix kernel and dtbs were replaced with ROCKNIX versions. There were tons of features that didn't work for some reason (like the gamepad). Now, the kernel and dtb is built in the flake. It doesn't yet build the bootloader (you only need to do this once) but full rebuilds work if you use remote deployments.

Since it also builds using the patches from ROCKNIX, everything that works there also works here. From my testing it seems like everything firmware-related is good. There are definitely a lot of bugs, like the secondary SD card randomly being dismounted or not recognized on boot with some whack warnings. Things like the vibration motor (somehow) also work without any prior configuration from my end (which was a very pleasant surprise).

Why NixOS for a handheld?

There's a few advantages to NixOS over more popular handheld distros like ROCKNIX or ArkOS. For starters, it should be noted that NixOS is a full desktop operating system, to the likes of Ubuntu or Arch. It has a package manager and seeing that the device is a very capable and affordable little computer, using an operating system only capable of emulation is very limiting. With NixOS you can do everything that other distros do but more. Depending on your configuration, there also seems to be some performance gains as well. Game emulation loading speed from within Retroarch is very quick, and given the system's massive configuration opportunity this can be optimized further.

Software & game support

In it's current form, I am keeping the device ultra lightweight and performant. Things like menu/game switching should be as fast as possible. To achieve this I'm running everything on KMS/DRM so there's no compositor or overhead of something like Wayland. And it's super fast! Switching between games is almost instant. I'm additionally leveraging Retroarch to manage the device instead of something like EmulationStation. You can actually build Retroarch to give you Bluetooth & networking control using it's drivers, and it works very well. Plus it displays your battery and the time, so what really do you need a layered frontend like EmulationStation for?

To support things like launching Portmaster, there's a kind of hacky workaround to run the launch script. But once you run the app once, it'll appear in your history which makes it much easier to access. This system could be expanded to run other scripts to launch things, like maybe a desktop mode or Moonlight.

Where to go from here

Right now the system is in my personal system flake. Maybe if it becomes a popular enough alternative to current handheld distros I'll move it to its own repository and modularize it so people can make their own flakes. For now if you want to make modifications, you can fork my flake.

As far as performance goes, GPU accel works with Panfrost and I haven't had any issues with playing games, but someone should probably run some statistics. There's a lot of optimization opportunity and it would be great if someone with more experience could help me out with volume management between Retroarch & Portmaster (it's a buggy, vibecoded mess right now). There's thigns like DS games not running well (which doesn't signal anything good for emulating things like PS1 or PSP games) so more tweaking needs to be done to expand emulation capabilities.

There's some stuff like Moonlight which would be cool to have. Maybe some way to access network/volume/bluetooth/battery from within a Portmaster game? Potentially even desktop mode which opens Sway & a web browser? (There's a Manjaro desktop build which does this and runs very well)

Build it yourself

I don't really intend on this being much of a tutorial, but if you want to build a working image for the RG35XX-H, you should build an image from the flake (use nixos-rebuild build-image --image-variant sd-card --flake .#alechandheld inside the flake) & flash it alongside the bootloader. You can then update the device using sudo nixos-rebuild boot --flake .#alechandheld --target-host alec@<device local ip> --sudo --ask-sudo-password --no-reexec from a host machine that supports aarch64 cross compilation. On first boot, you'll be put into Retroarch & you should set a password for the root & main user (by default the user password is nixos).

Usage

I suggest running the OS on a 16GB SD card and then using the second SD card slot for your other games/content. It's safer to store your content seperately and you can recover to a working state quicker in case one of the cards fail (which is really common on these devices). I'm currently working on having save data back up to the secondary SD card as well so the internal card is only used for OS purposes.

You can add more cores or other applications directly in the Nix config! There's a lot of Retroarch cores pre-packed in Nixpkgs.

USB, battery, gamepad/buttons (& volume/power buttons), GPU/display/backlight, Wifi/bluetooth, sounds and the second SD card slot all work which is pretty much everything you need. Unfortunately it seems like HDMI output on Retroarch is borked since it offsets the display halfway between the built in panel and the output panel, but otherwise works elsewhere.

Right now the flake is extremely stable save for a few random mounting issues. I've been daily driving this thing and the only things you need to remember are to reboot it often (especially after sleeping for a while) and checking the battery often (there's no warnings when using Portmaster!)

From a hacker's perspective

This device is definitely not specced-out in any way but considering its ability to now run practically any distribution for such a low price point (going down to $50 during sales) and having a battery, display, a gig of RAM, great IO (2 SD slots, 2 USB-C ports, HDMI, audio), there is a lot of opportunity to this device. You could use it as a portable server or a little convergence device. And seeing that I basically just applied all the patches from ROCKNIX to make this work, you don't even need the same device to run this. You could theoretially run the same flake on other H700 hardware by just applying the devices patches. Lots of things you can do with the device now!

See previous handheld entry


Copyright © Alec (AmazinAxel) 2016 - 2026 • All Rights Reserved

This entry was last updated on April 4th, 2026