After more than 5 years, Pi-hole is now finally available in nixpkgs/NixOS!
https://github.com/NixOS/nixpkgs/pull/361571
The package request was one of the most upvoted nixpkgs issues.
There is also a NixOS module available, you can find the options here: https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=services.pihole
There were other good options with comparable functionality before (adguard-home, blocky), but it's still nice to have for people migrating from non-NixOS pi-hole.