Systemd wait for timesync?

I’ve got a raspberry pi flake which runs a systemd service which needs correct time before starting. Adding after = [ "" ]; isn’t sufficient to wait until time is actually synchronized, as that just waits until the time sync starts. This blog post mentions that the best solution is to enable systemd-time-wait-sync.service in order to make block until the clock is actually synchronized, but systemd-time-wait-sync.service doesn’t seem to be used in nixpkgs.

This has led me to RFC: Accurate time synchronization dependencies via - #2 by Mic92 with the latest comment that states this functionality is not implemented and the PR appears to be not merged (nixos: make block until initial adjustment with all NTP daemons by thoughtpolice · Pull Request #51338 · NixOS/nixpkgs · GitHub)

What’s the easiest path forward for me to enable "systemd-time-wait-sync.service" to my configuration?

This nixos configuration might work:

  systemd.additionalUpstreamSystemUnits = [ "systemd-time-wait-sync.service" ];

Thanks! Got it working after also needing to do = [ "" ];