Flake with grouped packages doesn't work

I have a flake that’s meant to add a few packages to nixpkgs and I’d like to “group” them somehow. I thought this would work:

outputs = { self, nixpkgs }: {
  overlays.default = final: prev: {
    group-of-packages = {
      package1 = ...;
      package2 = ...;
      ...
    };
  };
}

However, when I import this flake in another flake via:

let pkgs = import nixpkgs {
  system = ...;
  overlays = [ my-flake.overlays.default ];
};
in {
  packages.foo = mkDerivation {
    buildInputs = [ group-of-packages.package1 ];
  };
}

it doesn’t find package1. If I move it one layer up, it works.

Do I have to do anything special to have this grouping?