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
| Key | Action |
|---|---|
↑ / ↓ | Navigate results |
/ or type | Filter / fuzzy search |
Enter | Show option details |
Tab | Switch source (NixOS / HM / …) |
q / Esc | Quit |
Sources
optnix discovers options from module systems automatically. Supported sources:
| Source | Description |
|---|---|
nixos | NixOS system options |
home-manager | Home Manager user options |
nix-darwin | macOS system options via nix-darwin |
flake-parts | Options from flake-parts modules |
| Custom | Any 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