Searching packages: Difference between revisions

Gerg-L (talk | contribs)
fixed nix-index link, updated nix repl section mention rippkgs
m Fix typo
 
(6 intermediate revisions by 4 users not shown)
Line 4: Line 4:


There is a web service to search with
There is a web service to search with
: [[channels]]
: [[channel branches]]
:* Nix packages at [https://search.nixos.org/packages search.nixos.org/packages]
:* Nix packages at [https://search.nixos.org/packages search.nixos.org/packages]
:* NixOS options at [https://search.nixos.org/options search.nixos.org/options]
:* NixOS options at [https://search.nixos.org/options search.nixos.org/options]
Line 15: Line 15:
* allows filters
* allows filters
* nice GUI in browser
* nice GUI in browser
* browser extensions possible (like @nixpgs as search engine in Firefox)  
* browser extensions possible (like @nixpkgs as search engine in Firefox)  
; cons:
; cons:
* always requires Internet connection  
* always requires Internet connection
 
 
If you'd like to search with this web service from the command line, you may use [https://github.com/peterldowns/nix-search-cli peterldowns/nix-search-cli]. It provides exactly the same search experience by default.
 
== Other online sites for searching ==
 
These are another possible places to search
 
* [https://github.com/search?q=language%3ANix+&type=code github.com] - search for regex/strings in nixpkgs, home-manager, nix-darwin and any other public github repos.
* [https://mynixos.com mynixos.com] - search for packages in nixpkgs, also nixos, home-manager, nix-darwin options. Not foss and unofficial.
* [https://home-manager-options.extranix.com home-manager-options.extranix.com] - search for home-manager options. [https://github.com/mipmip/home-manager-option-search foss]


== Using the <code>nix search</code> command ==
== Using the <code>nix search</code> command ==
Line 31: Line 42:
* requires disk space for caching
* requires disk space for caching
* quite long command  
* quite long command  
There are third party tools that allow searching for packages similarly to <code>nix search</code>, namely:
* [https://github.com/diamondburned/nix-search diamondburned/nix-search]: A faster and channel-compatible <code>nix search</code> using only stable Nix tools (no [[flakes]] required) which creates a local database with a package index.


== Using the <code>nix-env</code> command ==
== Using the <code>nix-env</code> command ==
Line 65: Line 80:
== Reverse search: searching which package provides a file ==
== Reverse search: searching which package provides a file ==


There is third party programs [https://github.com/nix-community/nix-index nix-index], and [https://wiki.nixos.org/wiki/Flakes rippkgs] to find which package provides a given file. This is particularly useful when you are looking for a very specific file but you don't know which package installs it.
There are third party programs that make it easier to determine which package you need to install in order to obtain a specific file or program.
 
These are most commonly used, and require you to create an index on your computer before you can search for a package:
 
* [https://github.com/nix-community/nix-index nix-community/nix-index]
* [https://github.com/replit/rippkgs replit/rippkgs]
 
These are online tools which search an index someone else keeps up to date:
 
* [https://github.com/peterldowns/nix-search-cli peterldowns/nix-search-cli]: <code>nix-search -p theBinaryIWantToInstall</code> to search the search.nixos.org elasticsearch index.


[[Category:Reference]]
[[Category:Reference]]
[[Category:Nixpkgs]]
[[Category:Nixpkgs]]