When simply trying to run a program that is not installed (e.g., pdflatex
) on the command line, Nix gives clues:
$ pdflatex
The program ‘pdflatex’ is currently not installed. It is provided by
several packages. You can install it by typing one of the following:
nix-env -iA nixos.texlive.combined.scheme-basic
nix-env -iA nixos.texlive.combined.scheme-minimal
nix-env -iA nixos.texlive.combined.scheme-small
but these are not the only packages that provide it,
$ nix-shell -p texlive.combined.scheme- # TAB TAB
texlive.combined.scheme-basic texlive.combined.scheme-gust texlive.combined.scheme-minimal
texlive.combined.scheme-context texlive.combined.scheme-infraonly texlive.combined.scheme-small
texlive.combined.scheme-full texlive.combined.scheme-medium texlive.combined.scheme-tetex
search.nixos.org can’t do such queries (or did I miss something?), and the only other resources in this topic that I could find are more generic (and a solution to them woud be even more welcome):
-
Nixpkgs issue #1751, Which package provides file “foo” (Closed, but with an entirely different reason to what the issue raised originally.)
-
https://unix.stackexchange.com/questions/252224/how-to-find-out-which-not-installed-package-a-file-belongs-to-on-nixos thread suggests
nix-index
; according to the answers and after reading the bennofs/nix-index repo’s README this may just be it, but wasn’t able to tryi it out yet (contrary to the description that “it takes around 5 minutes”, it gobbled up all the resources, and had to terminate it after 20 minutes, so this will have to wait until after work)