itโs called gitops believe it or not.
https://www.reddit.com/r/NixOS/comments/r1ua00/gitops_for_nixos/