Routing all network traffic through Tor

Hi, I was looking for a way to route all traffic through tor. I know scripts like torctl or ghostnet achieve this but they are yet to be ported to nixpkgs (and my attempts at packaging them have been futile due to their complexity and use of changing the global system state).

Has anyone got any currently working methods to do this on NixOS unstable?

Thanks a lot.