Brainstorming Generating AppStream Metadata

I’ve been looking at some possibilities for creating appstream data for NixOS. I threw together a small tool as a proof of concept here: GitHub - vlinkz/nixos-appstream: Proof of concept appstream data generator for NixOS. Pretty much it builds a package, checks for packaged appstream data, and if not construct the data from the included .destkop file and nix metadata. I’m not too familiar with hydra and how to possibly optimize such a program to work with it well. I’ve read over the previous RFC here: RFC: Generating AppStream Metadata · Issue #15932 · NixOS/nixpkgs · GitHub, and they seemed to suggest using GitHub - ximion/appstream-generator: A fast AppStream metadata generator, but that would require a backend to be written in d.

So making some sort of program that hooks into hydra and aggregates all the appstream data from built packages seems like a good solution, however, the main issue I see with that is, as far as I know, no unfree packages are built on hydra, so anything using hydra would only be part of a solution. I’m a bit stumped on how to approach this.

Some possibilities I thought of could be building metadata for unfree packages based solely on the metadata provided in nixpkgs. But then unfree packages like google-chrome, which do have bundled appstream data, would not have their data correctly represented on any built database. The thing that could be an issue is that even if there was an easy way to get appstream data for unfree packages, would hosting their icons as part of the package make the appstream package itself unfree?

Is there any easier or obvious way of doing this that I’m missing? Maybe just expanding the current metadata options offered in nixpkgs would be an acceptable solution. I saw a pull request from a couple of years ago addressing adding screenshot support: Add new meta-attributes to stdenv to permit URLs for screenshots by StefanSchroeder · Pull Request #101417 · NixOS/nixpkgs · GitHub. Any ideas are appreciated!