Nix github or Tarball meta data - rev - and json file dump

Hello
I would like to get the meta data about nixpkgs unstable

something like

builtins.fetchGit { url = "https://github.com/NixOS/nixpkgs-channels/tree/nixpkgs-unstable"; }
{ ... rev= ... }  (date= ..  would also be nice)

after retrieving the set of meta data I would like to dump that as json file.


How to do that is an short and efficient way in nix