I am aware there is already a topic with the same name, so Discourse forced me to add the 2 in the title, but the “answer” there is not an actual answer to the (general) question.
I often wonder things like “Why is xterm installed? There is no xterm in my systemPackages?” or “Why is nano installed? I use vim and would never install nano”.
Then I do:
$ nix-store -q --referrers /run/current-system/sw/bin/xterm
/nix/store/2rkf9d0lc6f5cjfsznki5hs4pjn4gi9f-xterm-375
/nix/store/ci07973sm48pvk1k402h6lcs6f64chgy-system-path
/nix/store/hpnbrli2rqga7i3p357q47g3fpqy45mf-system-path
/nix/store/isnnp0kyn6n7ah0w1j0cxcsqpb2b1njf-system-path
/nix/store/ly9klxx5nc89cmsz74ilsmcby8158lzp-system-path
/nix/store/nr049757k47ys6bniwrbdzz97rhy946p-system-path
/nix/store/prr16z555a78p4nmm8p3aigywjm18bfs-system-path
/nix/store/xkd0aqbjqmy14pgx7d9xa78mavzvnc98-system-path
So obviously, my system configuration requires xterm to be installed. But how do I find out what option causes xterm to be installed?