Writing a Maven plugin (ie. a reusable piece of configuration management logic) is easy because you can use any library from the vast Java ecosystem (just add a library as a dependency of your plugin).
Doing the same in Nix requires recreating these libraries in Nix.
Looks like Maven might simply be the right choice...