Is there a way to get information on package installation counts?

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.

1 Like

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:

3 Likes

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.

2 Likes

Potentially, there could be several such GUI applications, and therefore they would need a unified backend tied to statistics for a single database :thinking:.

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.

2 Likes

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.

1 Like

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!