However, this does not work if the package is a Python package, as those need to go one level deeper: inside python<N>Packages.
I have found instructions in the official manual showing how to override parts of an existing Python package, but for the case of adding a new Python package, I haven’t managed to find an approach that works.
Can you suggest a reliable recipe for adding a Python package using overlays?
(I’m trying to do this in a flake, in case that changes anything.)
but that same commit introduces numerous changes to various files in the nixpkgs infrastructure, from which I infer that the documented approach depends on those changes. As the PR has not been merged, it would seem that this approach is not going to work in a current nixpkgs. What have I misunderstood?
I’m using exactly this snippet both in configuration.nix and in project environments
EDIT 2023-08-14: Since a while ago you can skip python3 = let self = ... ; in self and use pythonPackagesOverrides instead: Nixpkgs 23.11 manual | Nix & NixOS
You could define a single packageOverrides and apply it to several attributes (python39, python310, etc). Similarly, you can define the filter ps: [ ... ] once, and use it for multiple python wrappers. Are you sure you really need any of this though?