tl;dr maybe terribly misunderstanding things (xy-problem?), or maybe just need help translating nix-store values (see 2 questions at the bottom). Ultimately hunting down an insecure package, but separately I’m generally curious about nix-store paths vs. packages and how to see the dependents.
I’m seeing an error that freeimage-unstable-2021-11-01
has been marked insecure (and then the expected mesasge about my options, like using NIXPKGS_ALLOW_INSECURE=1
etc).
My first question is: “what is that package? I don’t recognize that” (because maybe I’ll find a replacement for whatever the problematic package is). So searching the web for “find dependents of nix package” I came across this stackexchange post suggesting:
nix-store \
--query \
--referrers \
/nix/store/kda2wbkcirc8s8ip7hkb2k5jy4hqshgq-nixos/nixos/pkgs/development/libraries/freeimage/default.nix
I ran that in a loop recursively, hoping I’d get to “leaf” level dependents that I’d personally installed like “gimp” or something, but I only have this to show as output:
referrers to "/nix/store/kda2wbkcirc8s8ip7hkb2k5jy4hqshgq-nixos/nixos/pkgs/development/libraries/freeimage/default.nix":
/nix/store/hszf0mhd97vl9yvaqpjrs7k3rvrllkk7-env-manifest.nix
/nix/store/x0k06h09wxxp97066s26idn91fjpnbsc-user-environment
referrers to "/nix/store/hszf0mhd97vl9yvaqpjrs7k3rvrllkk7-env-manifest.nix":
/nix/store/r1pq3g7mdp2h4yn2z1wzpzzy4m50m630-user-environment.drv
/nix/store/x0k06h09wxxp97066s26idn91fjpnbsc-user-environment
The problem is that I don’t recognize those paths and they don’t contain something like /freeimage/
I can go search for (the way that first nixstore path has in it).
so two questions I think I have
- a) is there a different command I can run if I don’t know the path? (eg: the
nix-store
query above requires a path, but say I only knowfreeimage-unstable-2021-11-01
) - b) inverse of (a): is there a command I can run to turn those paths back into the human-readable package names they represent?