Forrest logo
back to the nix-env tool

nix-classic:tldr:c7c06

nix-classic: Search for a package in nixpkgs via its name.
$ nix-env -qaP ${search_term_regexp}
try on your machine

The command "nix-env -qaP ${search_term_regexp}" is used in Nix package manager to search and list packages that match a given regular expression.

Here's an explanation of each part of the command:

  • "nix-env": This is the command-line tool for managing user environments in Nix.
  • "-qaP": These are options and arguments for the "nix-env" command.
    • "-q" stands for "query" and is used to search for packages.
    • "-a" stands for "all" and is used to search for package names.
    • "-P" stands for "paths" and is used to display the paths to the packages.
  • "${search_term_regexp}": This is a placeholder for the regular expression used to search for packages. You need to replace "${search_term_regexp}" with the actual regular expression you want to use. Nix will match this regular expression against the package names.

For example, if you want to search for all packages with names starting with "python", you would run the command "nix-env -qaP 'python.*'". This will list all Python-related packages, along with their corresponding paths.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the nix-env tool