Forrest logo
back to the nix tool

nix3-search:tldr:cf189

nix3-search: Show description of a package from nixpkgs.
$ nix search ${nixpkgs#pkg}
try on your machine

The command "nix search ${nixpkgs#pkg}" is using the Nix Package Manager to search for a package within the Nixpkgs repository.

Here is a breakdown of the command:

  • "${nixpkgs#pkg}" is a shell parameter expansion that takes the value of the "nixpkgs" variable and replaces any occurrence of "pkg" at the beginning with an empty string. For example, if "nixpkgs" was set to "mypkg", then "${nixpkgs#pkg}" would result in "mypkg". This is typically used to remove a prefix from a variable's value.

  • "nix search" is a command that allows you to search for packages in the Nixpkgs repository. It queries the available packages and displays information about them, such as their names, descriptions, and versions.

So, when you run the command "nix search ${nixpkgs#pkg}", it will search for packages within the Nixpkgs repository, using the value of the "nixpkgs" variable with any leading "pkg" removed. The result will be a list of packages that match the search criteria.

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 tool