snowfallorg / nix-software-center

A simple gtk4/libadwaita software center to easily install and manage nix packages
GNU General Public License v3.0
560 stars 16 forks source link

Packages installed by options not listed as installed #12

Open davidak opened 1 year ago

davidak commented 1 year ago

For example Steam:

Screenshot from 2022-11-16 22-17-54

Maybe there would be a way to recognize this situation and integrate with nixos-conf-editor to have one button to edit it there.

vlinkz commented 1 year ago

I have considered showing something along these lines, however, currently, there isn't a good way to figure out exactly which packages are installed by which options other than evaluating all of nixpkgs. I've seen that nix-store --query --requisites /run/current-system shows all derivations, but there isn't always a 1-1 match from derivation to attribute, so it would be as unreliable as nix-env. It could probably be done manually in the future though

davidak commented 1 year ago

I think maintaining the matching manually is too unreliable, because it will easily get out-of-date.

Could we or Nix cache the result and have to evaluate nixpkgs only once? I think they do that for available packages, so it should be possible to do it with options as well.

vlinkz commented 1 year ago

Yeah that could be done, not sure how to do it though since that information doesn't seem to be in the evaluated options