Are there any examples how to add Python modules to existing packages?

I want to use Home-Assistant on NixOS which is based on Python. It has a lot of dependencies which are not bundled with the Nix package since there are a lot of integrations for services and hardware available. There’s also the option pkgs.home-assistant.override available to add some of the packages which are available in the Nix Store. But at least in my case, many packages are missing. I also discovered nixpkgs-pytools but I don’t know how this tool can help me with my problem.

Are there any examples/tutorials available how to add dependencies like this to a package? I’d like to avoid to use a Nix shell for this.

there are a lot of different ways you could approach this.

i would bundle all the extra packages needed into an overlay. this way you can add/remove components easily. depending on how many packages you need you can also write the derivations yourself instead of using nixpkgs-pytools, it’s not too complicated.

you can have a look at the relevant sections of the nix manual
Overlays/Python and the wiki Overlays/Python.

if you need some inspiration you can take a look at my overlay here