With ansible you need to change the relevant step to use apt remove instead of apt install and to change the config file step in a step that removes the file.
Wait until you have 2 services that use the same resource. Now you need:
- When both are enabled the resource is set up.
- When either one is enabled the resource is still set up.
- When neither is configured the resource is removed.
Doing this with Ansible is a nightmare. And 99% of the time you don't even realize that you have this problem until your configs don't work for some reason.
I would probably just ignore the Makefile provided by upstream. It just copies files and installs dependencies.
I would take a look at existing python derivations in nixpkgs (ex a random one I picked) and try to modify it to work with your package. Once you have it working well you could even submit it to nixpkgs!