optnix
2 min read

Fast terminal option searcher for Nix module systems. Searches and inspects options across NixOS, Home Manager, nix-darwin, flake-parts, and custom modules — including options defined in your own flake.

Install

Available in nixpkgs:

sh
nix-shell -p optnix
# or try without installing
nix run nixpkgs#optnix

Add permanently:

nix
environment.systemPackages = [ pkgs.optnix ];

Usage

Launch interactive TUI (fuzzy search across all configured sources):

sh
optnix

Search directly from the command line:

sh
optnix search networking.firewall
optnix search services.nginx

Evaluate a specific option value from your active configuration:

sh
optnix eval services.openssh.enable
optnix eval home-manager.users.alice.programs.git.enable

TUI Keys

KeyAction
↑ / ↓Navigate results
/ or typeFilter / fuzzy search
EnterShow option details
TabSwitch source (NixOS / HM / …)
q / EscQuit

Sources

optnix discovers options from module systems automatically. Supported sources:

SourceDescription
nixosNixOS system options
home-managerHome Manager user options
nix-darwinmacOS system options via nix-darwin
flake-partsOptions from flake-parts modules
CustomAny module system exposing a options attrset

Custom module options defined in your own flake are automatically included when optnix is run inside a flake-aware context.

Configuration

optnix can be configured via ~/.config/optnix/config.toml:

toml
# Prefer a specific source as default tab
default_source = "nixos"

# Additional module paths to index
extra_modules = [
"/path/to/my/custom/module.nix"
]

Integration

nixos-cli

optnix is embedded as the backend for the nixos option subcommand in nixos-cli. Zero configuration needed — option discovery is automatic for NixOS systems.

sh
nixos option search services.nginx
nixos option eval services.nginx.enable