I set up a systemd job to run at shutdown to run Borg. The hardest part wasn't the Nix setup, but getting the right systemd magic words.
https://github.com/Xophmeister/backer-upper/
I believe there are NixOS options to do this periodically -- which is even easier -- but I specifically wanted on-shutdown backups.