The Rambling Homelabist

Raspberry Pi CM4 Time Server with NixOS!

Inspired by Jeff Geerlings videos on time I decided to build myself a time server. Found a GPS antenna on sale (I paid $75 for it, it was slightly dented in a way that affected absolutely nothing), and I had almost all the other parts. Well, I say that, really all I had was the CM4. I had to get everything else:

So I could've done this the easy way, and used diet-pi or just raspberry pi OS, but I didn't want to do that. I wanted it to be as repeatable as all my other installations, and so I decided to do this with NixOS. Raspberry PIs aren't the most common target for a nixos box, as the actual building of the system is quite a bit of work, and a small 2gb CM4 really isn't up to the task.

I do have a Turing PI v2 loaded up with Turing RK1 modules, however, and that gives me plenty of arm64 horsepower with which to build the TimePI OS and deliver it over. If I didn't have any of this other infrastructure in place, I'm not sure doing this would make a whole lot of sense. I could've used a Free Oracle Cloud ARM64 box to build it, and there's even instructions on how to get NixOS on there that I have done as well.

Then you'll need some aditional help to actually build the thing remotely and send it over to the device, but that's possibly a topic for a different post.

My configuration is defined entirely in nix.

I opted for satpulse on the recommendation from a friend, and I have no regrets. Following the setup instructions there and a bit of work to create for myself a nixpkg for it and I was shortly running a satpulse instance on my Time Pi.

I basically followed the instructions on satpulse's site, but I did make one small tweak. I opted to run ntpd-rs instead of chrony. Nothing at all wrong with chrony, I have used it to great success in the past, but I'm a rust fanboi, and so I had to do it obviously.

ntpd-rs Grafana Dashboard
Search