11

How do I get more details about a nix package, e.g. to verify that it actually is what I think it is.

In Debian, I would use apt-cache show; but how do I get similar information for nix? A command to show the derivation for an arbitrary package would be good enough, since I can probably use the src line to find the website hosting the project.

jpaugh
  • 319
  • 2
  • 13
  • There is a site for Nix [packages](https://nixos.org/nixos/packages.html) and one for NixOS [options](https://nixos.org/nixos/packages.html) – wizzup Nov 16 '17 at 11:26

1 Answers1

8

Pass the --description flag to nix-env -qa ("query available") for a brief summary, or pass --json (or --xml --meta) for more verbose output, with similar content to that available on Debian; though you'll probably also need something that can wrangle those forms to human readable

# nix-env -qa --description neovim
neovim-0.2.0  Vim text editor fork focused on extensibility and agility
# nix-env -qa --json neovim
{"nixos.neovim":{"name":"neovim-0.2.0","system":"x86_64-linux","meta":{"descriptio...
jpaugh
  • 319
  • 2
  • 13
thrig
  • 34,333
  • 3
  • 63
  • 84
  • Thanks! I wonder why `--description` is not the default? I made an edit to emphasize the needed options, since I didn't realize `nix-env -qa` had an alternate output. – jpaugh Nov 16 '17 at 17:15
  • 1
    note: not all packages have descriptions – Knu Jan 11 '19 at 03:52