https://nix.dev/tutorials/deploying-nixos-using-terraform.ht... showcases how you can use terraform to provision things and Nix to describe the machine.
There's also https://terranix.org/ to configure Terraform using Nix.
There's also https://terranix.org/ to configure Terraform using Nix.