How to add a shellHook to wrapGAppsHook

I want to add a shellHook to wrapGAppsHook, so that when you use nix develop or direnv’s use nix, the appropriate environment variables are also set for you to work on a GTK project.

However, adding a shellHook to it via an overlay, like this:

  wrapGAppsHook = super.wrapGAppsHook.overrideAttrs (prev: {
    shellHook = ''
      echo "wrapGAppsHook shell hook"
    '';
  });

doesn’t seem to work.

Any suggestions? How nix print-dev-env/nix develop figures out the environment is a bit too complicated for me…