I’m trying to figure out how to toggle the main red power light on a Raspberry Pi.
On a non-NixOS system, I’d run echo none | sudo tee /sys/class/leds/led1/trigger, and revert that with echo default-on | sudo tee /sys/class/leds/led1/trigger. But on my NixOS Pi, the only LEDs I can find are /sys/class/leds/mmc1:: and /sys/class/leds/ACT, neither of which seem to correspond to the one I’m trying to manipulate.
FWIW, the NixOS device is a RPi3, while the other I’m testing with is a RPi4, but I’d be surprised if that was what’s making the difference.
In particular, this comment looks promising, but ./rpi3-gpiovirtbuf c 135 1 0 0 0 0 fails with error: open: /dev/vcio: No such file or directory. Might that functionality exist at a different location on NixOS?
That sounds reasonable. I added boot.kernelPackages = pkgs.linuxPackages_rpi3 to my config (along with this workaround.
But it doesn’t boot! Some text is printed, than I eventually get a black screen and the heartbeat LED turns off. The text moves too quickly for me to see what happens at the end, and I can’t find any way to access the log after the fact.
I’ve reverted back to the old config for now, but I would really love to get this working.