Ansible is less declarative, but it's basically just ssh. No agents, no custom user installs no OS. So it depends what your aim is.
Ansible is great to deploy stuff with. Not perfect and not like terraform+k8s/docker.
Nix may be more for developers, as you'll end up developing for it.