Finding packages and options

Every edit to a Ternix config requires two pieces of information before you can write a single line. For a package, you need the attribute name in nixpkgs, which is what goes in the list. For an option, you need the full dotted path and the type it expects. This page shows the fastest routes to both.

Finding packages

The thing that trips up newcomers most often is that a package's attribute name in nixpkgs is not always the name of the program or the name of the binary it installs. The binary rg is installed by the attribute ripgrep. The binary nvim is installed by neovim. The binary ag is installed by the_silver_searcher. Always confirm the attribute name before adding a package to your config.

The Ternix Packages browser

The Ternix Packages page searches nixpkgs by keyword and shows the attribute name, version, and a short description for each result. It is a fast first stop when you want to stay in the browser.

NixOS package search

search.nixos.org/packages covers the full nixpkgs package set. Each result card shows two names. The Attribute name is what you put in your config. The Name field is the package's own name as set in the derivation, which sometimes differs. Use the attribute name.

CLI search

nix search queries nixpkgs from the terminal without opening a browser. The generated Ternix config enables the nix-command and flakes experimental features that this command requires.

nix search nixpkgs ripgrep

Each match appears as a line beginning with * followed by the package path in the form legacyPackages.x86_64-linux.<attribute>. The part after the last dot is the attribute name to use in your config.

* legacyPackages.x86_64-linux.ripgrep (14.1.1)
  A search tool that combines the usability of ag with the raw speed of grep

The attribute name here is ripgrep. You can search for multiple words and pipe through grep to narrow results.

nix search nixpkgs "pdf viewer"
nix search nixpkgs rust | grep -i "language server"

Finding options

Options are the typed settings that NixOS modules declare and you assign values to. The option services.openssh.enable exists because the upstream OpenSSH module declares it, sets a default of false, and reacts to the value you give it. Before setting an option you need its full dotted path and the type it expects.

The Ternix Options browser

The Ternix Options page searches the full NixOS option set and shows the type, default, and description for each result.

NixOS option search

search.nixos.org/options is the authoritative web reference for NixOS options. Every entry contains four fields worth reading.

The type tells you what values are valid. A boolean takes true or false. A list of packages takes a Nix list of derivations such as [ pkgs.git pkgs.curl ]. Assigning a value of the wrong type produces a clear type error at build time.

The default is the value the system uses when you leave the option unset. Most service options default to false and most optional string options default to null.

The example shows a realistic value you can copy directly into your config.

The declared in field names the nixpkgs module file that owns the option. Following that link shows exactly what the module does when the option is set, which is useful when the description is too brief to go on.

Searching for a prefix such as services.postgresql returns all options under that subtree. This is a good way to discover what a service exposes before you start configuring it.

Reading an option on a running system

nixos-option prints the type, default, declared locations, and current value for any option path on the live system. It works only on a running NixOS machine.

# print the type, default, and current value of one option
nixos-option services.openssh.enable
 
# walk into a nested option set to see what is under it
nixos-option services.openssh.settings

On a machine where nixos-option is not available, nix eval against your flake gives the evaluated value directly.

nix eval .#nixosConfigurations.nixos-host.config.services.openssh.enable

Finding Home Manager options

Home Manager has its own option set, separate from NixOS options. The paths look similar but are distinct. Home Manager options live under programs.*, home.*, services.* (user-level services), and xdg.*, among others.

The Home Manager manual is the authoritative reference. The options appendix at nix-community.github.io/home-manager/options.xhtml is an alphabetical list of every option with its type, default, and example. It is the fastest way to confirm whether an option exists or to check the exact field names under a programs.* block.

For a more interactive search, home-manager-options.extranix.com covers the same option set with a filter box.

Home Manager has no CLI equivalent of nixos-option. To inspect an evaluated Home Manager config from the terminal, use nix eval against the home configuration output.

nix eval .#homeConfigurations.user.config.programs.git.enable

Mapping a result into your config

Once you have an attribute name or an option path, the next step is writing it into the right file.

A found package goes into a package list. For system-wide packages on NixOS, that list is environment.systemPackages in configuration.nix. For a single user with Home Manager, it is home.packages in home.nix.

# configuration.nix
environment.systemPackages = with pkgs; [
  ripgrep   # the attribute name found in search
  neovim
  bat
];
# home.nix
home.packages = with pkgs; [
  ripgrep
  neovim
  bat
];

The with pkgs; prefix lets you write bare attribute names instead of pkgs.ripgrep for each entry. Without it, every name needs the pkgs. prefix.

A found option goes directly into your configuration file using its full dotted path. The path from the search result translates directly into Nix attribute syntax.

# configuration.nix
{
  services.openssh = {
    enable = true;
    settings.PasswordAuthentication = false;
  };
 
  time.timeZone = "America/New_York";
  networking.firewall.allowedTCPPorts = [ 80 443 ];
}

After editing, run the rebuild command to apply the change.

# NixOS system config
sudo nixos-rebuild switch --flake .#nixos-host
 
# Home Manager standalone
home-manager switch --flake .#user

Reading the manuals quickly

The web searches cover most day-to-day lookups, but the manuals go deeper on topics that a search result can only hint at.

The NixOS manual is organized by topic. The "Configuration" chapter explains how modules, options, and imports work together. The "Services" chapter groups service modules by category, and each service section describes its options in more detail than the search index does.

The Nixpkgs manual covers how packages are built and how to customize them. The chapter on overrides explains pkgs.<name>.override and overrideAttrs, which let you change compile-time flags or patch a derivation. The chapter on stdenv covers the build environment that most packages use.

Both manuals have a search input at the top of the page. For targeted lookups, your browser's Ctrl+F on a chapter page is often faster than the built-in search.

Next

  • Editing your config walks through adding packages and options to a real configuration.
  • Options and modules explains how options are declared, how types work, and how the module system merges values from multiple files.
  • Home Manager covers the full per-user configuration model.
  • Commands and scripts lists the rebuild, search, and inspection commands in one place.