… and similarly for pinentry-gnome though the nixpkgs source looks as if it should produce a pinentry-gnome3 (extra 3) package, so I’m even more confused.
You are looking at a wrong directory for pinentry-gnome, it would be result-gnome3/.
gtk2 flavour has been removed from the list of flavors enabled in the pinentry attribute. The top-level pinentry-gtk2 attribute was forgotten about and because the flavor attributes use lib.getOuput, it now points to ncurses flavour in out.
made me believe that there should be a pinentry-gnome3 package, whereas
nix build nixpkgs#pinentry-gnome3
error: flake 'flake:nixpkgs' does not provide attribute 'packages.x86_64-linux.pinentry-gnome3', 'legacyPackages.x86_64-linux.pinentry-gnome3' or 'pinentry-gnome3'
Did you mean one of pinentry-gnome or pinentry_gnome?
If I now restart gpg-agent with gpgconf --kll all I get the old gtk2 version of pinertry, when needed.
This gets me around my immediate problem, but I have no idea why/how this works, or whether it is a correct/stable solution, or how it relates to the removal of pinentry-gtk-2 to which you linked.
OK, so pinentryFlavor = "gnome3"; (in home-manager) or pinentryFlavor = "gtk2"; (equivalent to not setting pinentryFlavor at all, seem to be behaving sensibly.
But it seems that gtk2 has been deprecated 3 years ago, and gtk3 and gtk4 are both present in nixpkgs, but pinentry only comes in a gtk2 flavour (removed from nixpks, but still present in home-manager). Hmm. Should I stop using the gtk2 version?