I would like to sort packages by popularity. To do that, it seems I would need to know how many times a particular package has been installed. Is there a way to obtain this information in Nix? My apologies if the question is too naive.
As far as iām aware, Nix/NixOS doesnāt gather that information on its users, nor does it store how often a package is fetched. Also, this seems kinda hard to answer, as it really boils down to what you consider a āpackageā. Is a dependency of a package also a package?
I think the best answer would probably assume that whatās popular on NixOS is also popular on other similar distros, and steal borrow from a source that does aggregate this information:
I believe there are server-side stats of that on the cache, IIRC they were used when the cache cleanup assessment happened.
Those statistics are indeed unlikely to be useful for assessing package popularity the way a desktop-focused GUI might, though.
Potentially, there could be several such GUI applications, and therefore they would need a unified backend tied to statistics for a single database
.
Thatās not what I mean; in the context of nix the cache cannot distinguish between packages explicitly āinstalledā and ones that are just dependencies. The most āpopularā package by cache statistics would probably be whatever stdlib component updates most frequently.
Tbh I think nixpkgs is simply the wrong place for this kind of GUI-focused āpackageā management. Flathub exists, if you want users to have an app store, tell them to use that.
Personally, I have a different opinion on this matter. I believe that with a sufficient level of abstraction, an app center based on Nix applications is no worse than Flatpak. And in some aspects, Nix applications can be better than Flatpak applications because they do not have the limitations inherent to Flatpak applications. In any case, we may have strayed a bit from the topic of discussion.
Yea this is what i was hinting towards. āPackageā popularity is useless when all the most popular packages are dependencies.
What you could do is cross reference the cache stats with some other stats, like those above.
Right, you believe that by substantially changing the nature of the package repository, you can achieve some goal. Thatās a trivial tautology. What everyone else is telling you is that you canāt do it today, tomorrow, or probably not even in a year. Which answers the question asked in the title.
You and TLATER are indeed right about the dependencies. In that case, itās better to track the popularity not of all packages, but of those that have meta information (i.e., applications). In principle, our discussion has given me some thoughts. I think that in addition to your links, Flathub statistics could somehow be used to get a rough idea of a particular applicationās popularity. Thank you all for your responses!