I don’t have any pkgs.python*
in my OS:
❯ type -a python
bash: type: python: not found
After entering a Nix shell I’ve built, I notice there are two Python executables available:
❯ type -a python
python is /nix/store/z9nrcbp0bhwgml26rmxsrpn16q7pj28f-python3-3.11.9-env/bin/python
python is /nix/store/pgb120fb7srbh418v4i2a70aq1w9dawd-python3-3.12.5/bin/python
That is unexpected, since I only reference pkgs.python311
directly. I’d like to figure out what is pulling in pkgs.python3
(aka. pkgs.python312
in this version of nixpkgs); how do I do that?
I’ve already tried nix-store --query --referrers /nix/store/pgb120fb7srbh418v4i2a70aq1w9dawd-python3-3.12.5/bin/python
, but it lists a whole bunch of packages I have installed elsewhere in the system, and I can’t tell which ones of the several hundred trace back to my shell.
Some options for a usable command would be
- something which takes two store paths and prints the intermediate store paths,
- something which takes the Nix shell (or its store path) and prints its recursive dependencies hierarchically, rather than a flat list, or
- something which takes the Python store path and prints its reverse dependencies recursively and hierarchically.