Printing labels via SSH with Raspberry Pi Zero and Nix

16 points by nmattia


kokada

I remember in a NixCon (2022?) someone gave a talk about needing to run really old versions of Firefox because they need support for Flash or something similar, and how they got it running with Nix just by pinning an older version of nixpkgs. This is why reproducibility is important.

mtlynch

Thanks for this writeup!

I use a Raspberry Pi to drive my regular Brother printer with CUPS, but every so often the microSD gets corrupted, and I have to spend an hour remembering how I’ve configured it. I eventually kept a copy of the fully configured disk image, but that’s kind of hacky.

I’ve wanted to switch over to NixOS, but NixOS support for the Pi 4 is surprisingly spotty. I hadn’t considered doing Raspbian + Nix, as that might work.

The Raspberry Pi Zero is already (hard?) wired as microUSB “host” (for the curious: by shorting this extra “ID” pin to ground).

I believe this is incorrect.

The Pi Zero’s USB port supports USB OTG. I did a proof of concept showing how to use the Pi Zero’s USB OTG functionality to make the Pi pretend to be a USB keyboard and type keys.