nix3-search(1)

πŸ’… nix3-search(1) β€” the manual page, but make it make sense

okay bestie, welcome to nix3-search(1), straight out of the General Commands Manual. this one's for the nix CLI, and it's giving very useful, lowkey iconic energy. πŸŽ€

⚠️ Warning: this program is experimental and its interface is subject to change. like, she's still in her development era. don't come for her when the flags shift, okay? πŸ’€

✨ Name ✨

nix search β€” search for packages πŸ”

✨ Synopsis ✨

nix search [option…] installable regex…

✨ Examples ✨

okay so let's actually do some stuff, fr fr:

  • Show all packages in the nixpkgs flake:
# nix search nixpkgs ^
* legacyPackages.x86_64-linux.AMB-plugins (0.8.1)
A set of ambisonics ladspa plugins

* legacyPackages.x86_64-linux.ArchiSteamFarm (4.3.1.0)
Application with primary purpose of idling Steam cards from multiple accounts simultaneously
…
  • Show packages in the nixpkgs flake containing blender in its name or description:
# nix search nixpkgs blender
* legacyPackages.x86_64-linux.blender (2.91.0)
3D Creation/Animation/Publishing System
  • Search for packages underneath the attribute gnome3 in Nixpkgs:
# nix search nixpkgs#gnome3 vala
* legacyPackages.x86_64-linux.gnome3.vala (0.48.9)
Compiler for GObject type system
  • Show all packages in the flake in the current directory:
# nix search . ^
  • Search for Firefox or Chromium:
# nix search nixpkgs 'firefox|chromium'
  • Search for packages containing git and either frontend or gui:
# nix search nixpkgs git 'frontend|gui'
  • Search for packages containing neovim but hide ones containing either gui or python:
# nix search nixpkgs neovim --exclude 'python|gui'

or

# nix search nixpkgs neovim --exclude 'python' --exclude 'gui'

✨ Description ✨

okay so nix search searches an installable that can be evaluated β€” so like, a flake or a Nix expression, but not a store path or a deriving path β€” for packages whose name or description matches all of the regular expressions regex. 🌸

for every matching package, she prints the full attribute name (from the root of the installable), the version, and the meta.description field β€” and she highlights the substrings that got matched by your regular expressions. main character highlighting, honestly. ✨

wanna show all the packages? use the regular expression ^. and the way that this is better than .*?? .* highlights the entire name and description of every single package, which is lowkey a crime against your eyeballs. ^ does not. periodt. πŸ’…

πŸ“Œ Note: in this context, ^ is the regex character that matches the beginning of a string β€” it is not the delimiter for selecting a derivation output. don't confuse them bestie, they're different girlies. πŸ™ˆ

✨ Flake output attributes ✨

if you don't give a flake output attribute, nix search goes looking for packages:

  • Directly underneath packages.<system>.
  • Underneath legacyPackages.<system>, recursing into attribute sets that contain an attribute recurseForDerivations = true.

✨ Options ✨

  • --exclude, -e regex β€” hide packages whose attribute path, name or description contain regex. bye girl, not today. 🫢
  • --json β€” produce output in JSON format, suitable for consumption by another program. feed the machines. πŸ€–
  • --no-pretty β€” print compact JSON output on a single line, even when the output is a terminal. some commands may print multiple JSON objects on separate lines. see --pretty.
  • --pretty β€” print multi-line, indented JSON output for readability.

Default: indent if output is to a terminal.

This option is only effective when --json is also specified.

Common evaluation options

  • --arg name expr β€” pass the value expr as the argument name to Nix functions.
  • --arg-from-file name path β€” pass the contents of file path as the argument name to Nix functions.
  • --arg-from-stdin name β€” pass the contents of stdin as the argument name to Nix functions.
  • --argstr name string β€” pass the string string as the argument name to Nix functions.
  • --debugger β€” start an interactive environment if evaluation fails. girl help is on the way. 🧚
  • --eval-store store-url β€” the URL of the Nix store to use for evaluation, i.e. to store derivations (.drv files) and inputs referenced by them.
  • --impure β€” allow access to mutable paths and repositories. she's a little unhinged, we love that for her. πŸ”₯
  • --include, -I path β€” add path to search path entries used to resolve lookup paths.

This option may be given multiple times.

Paths added through -I take precedence over the nix-path configuration setting and the NIX_PATH environment variable.

  • --override-flake original-ref resolved-ref β€” override the flake registries, redirecting original-ref to resolved-ref.
  • --commit-lock-file β€” commit changes to the flake's lock file.
  • --inputs-from flake-url β€” use the inputs of the specified flake as registry entries.
  • --no-registries β€” don't allow lookups in the flake registries.
🚫 DEPRECATED Use --no-use-registries instead.
  • --no-update-lock-file β€” do not allow any updates to the flake's lock file. hands off. βœ‹
  • --no-write-lock-file β€” do not write the flake's newly generated lock file.
  • --output-lock-file flake-lock-path β€” write the given lock file instead of flake.lock within the top-level flake.
  • --override-input input-path flake-url β€” override a specific flake input (e.g. dwarffs/nixpkgs). The input path must not be empty. This implies --no-write-lock-file.
  • --recreate-lock-file β€” recreate the flake's lock file from scratch.
🚫 DEPRECATED Use nix flake update instead.
  • --reference-lock-file flake-lock-path β€” read the given lock file instead of flake.lock within the top-level flake.
  • --update-input input-path β€” update a specific flake input (ignoring its previous entry in the lock file).
🚫 DEPRECATED Use nix flake update instead.
  • --debug β€” set the logging verbosity level to 'debug'.
  • --log-format format β€” set the format of log output; one of raw, internal-json, bar or bar-with-logs.
  • --print-build-logs, -L β€” print full build logs on standard error.
  • --quiet β€” decrease the logging verbosity level. shhh. 🀫
  • --verbose, -v β€” increase the logging verbosity level. tell me EVERYTHING. πŸ‘‘

Miscellaneous global options

  • --help β€” show usage information.
  • --offline β€” disable substituters and consider all previously downloaded files up-to-date.
  • --option name value β€” set the Nix configuration setting name to value (overriding nix.conf).
  • --refresh β€” consider all previously downloaded files out-of-date.
  • --repair β€” during evaluation, rewrite missing or corrupted files in the Nix store. During building, rebuild missing or corrupted store paths.
  • --version β€” show version information.

Options that change the interpretation of installables

  • --expr expr β€” interpret installables as attribute paths relative to the Nix expression expr.
  • --file, -f file β€” interpret installables as attribute paths relative to the Nix expression stored in file. If file is the character -, then a Nix expression is read from standard input. Implies --impure.
πŸ“Ž Note: see man nix.conf for overriding configuration settings with command line flags.

and that's the whole page, bestie!! πŸ¦‹ she's from the General Commands Manual, she's nix3-search(1), and she ate. no cap. go search some packages, you got this πŸ’– ✨ πŸŽ€

πŸ“¦ where this page comes from