I’m using Nix on macOS and on (non-NixOS) Linux. I’d like to give Nix a package or attribute name and have it show me
I’m essentially looking for the Nix equivalent of Homebrew’s brew info packagename
.
How can I get Nix to give me these pieces of information?
With nix-env
on the CLI, I think the best we can currently and (relatively) conveniently do is JSON or XML:
$ nix-env --query --available --attr nixpkgs.hello --meta --json
# Or in terse form:
$ nix-env -qaA nixpkgs.hello --json
Neither output nor input are especially human-friendly, typical Nix usability…
The path to the .nix
file is listed as position
, also in the REPL as in Robert's neat answer it's hello.meta.position
. It is worth mentioning nix edit nixpkgs.hello
, for opening the file.