The tool (not intended to be a permanent deployment):
For example, for this build Hydra - Build 189501777 of job nixos:release-22.05:nixpkgs.nix.x86_64-linux, click the “Help” button on one of the build products to see:
$ nix-env -i /nix/store/7ghhnlwla2mddkg7hgqa5v0sr8g5hga8-nix-2.8.1 --option binary-caches https://cache.nixos.org
https://cache.nixos.org/ (add trailing slash) in the “cache base” field and the hash part of the path
7ghhnlwla2mddkg7hgqa5v0sr8g5hga8 in the “hash” field. (These particular values are pre-populated to make it easy for people to try out the tool.) Then click “view nar.”
Then you get a blank screen for a while, as it downloads the .nar.xz into memory, decompresses it, and parses it. Check the F12 developer console to see if things are working during this time. After that finishes, you get an expandable tree sort of thing that lets you explore the directories and files within. You can additionally click a file’s “create object url” button and then right click the “contents” link that appears to save a copy of that specific file.
I use the Nix package manager in some application-specific containers and I don’t have nix or nixos on my local computer, so it’s a little more of a hassle if I ever need to look at what’s in a package that I don’t have installed somewhere.
Inspiration comes from Debian having an online package search that can display the list of files in a package, e.g. Debian -- File list of package nix-bin/bullseye/amd64