I want to get a path for a package which not containing a bin dir(which cannot be used for it) in current generation on NixOS.
I know nix-store -r $(which some-program) and use nix-store -q to get more info about it. But now which cannot be used because this package doesn’t have outputs with bin.
I can use ls /nix/store | grep package-name, but this will list the package in some old generations without doing a garbage collection. I only want to find the one or ones in current generation.
I find nix-env -q --out-path can print a path by only using package name or attribute but I cannot find the system-wide profiles. For example, nix-env -q print nothing. Then I try to pass something to -p option such as /etc/profiles, /nix/var/nix/profiles/system and nix/var/nix/profiles/default, but it also prints nothing.
so you have to change the channel to match what channel the system is using, and then use sudo to evaluate it as root, otherwise you’ll just see your own personal/user channel.