'nix profile list' improvements
This makes nix profile list output more readable. Instead of one package per line like
6 flake:nixpkgs#legacyPackages.x86_64-linux.gdb path:/nix/store/4dng3sm5c3rxxw10vhx9lr9fclisz3zv-source?lastModified=1650244918&narHash=sha256-DsS5nxjTpnoUC4pNXJI1rit7TnDTij8vQDa5PtcDCD0=&rev=7b38b03d76ab71bdc8dc325e3f6338d984cc35ca#legacyPackages.x86_64-linux.gdb /nix/store/indzcw5wvlhx6vwk7k4iq29q15chvr3d-gdb-11.1
you get
Index: 6
Flake attribute: legacyPackages.x86_64-linux.gdb
Original flake URL: flake:nixpkgs
Locked flake URL: path:/nix/store/4dng3sm5c3rxxw10vhx9lr9fclisz3zv-source?lastModified=1650244918&narHash=sha256-DsS5nxjTpnoUC4pNXJI1rit7TnDTij8vQDa5PtcDCD0=&rev=7b38b03d76ab71bdc8dc325e3f6338d984cc35ca
Store paths: /nix/store/indzcw5wvlhx6vwk7k4iq29q15chvr3d-gdb-11.1
It also adds a --json flag (which just dumps the profile manifest to stdout).
I think it might make sense to also parse the "Locked flake URL" into multiple parts (e.g. {revision, last modified} is more interesting than the store path); maybe also hide the locked flake URL store path (or reduce it to just the revision) unless -v is given.
@thufschmitt @edolstra I rebased this PR so that it can be merged, see #8631. Feel free to either merge the new one or force-push my branch to yours to merge this PR.
The PR mentioned above was merged, so this one can be closed.