Skip to content

Configuration

nxv is configured through environment variables. All settings have sensible defaults.

Environment Variables

Database

VariableDescriptionDefault
NXV_DB_PATHPath to the SQLite index databasePlatform data dir

Remote API

VariableDescriptionDefault
NXV_API_URLUse remote API instead of local databaseNone
NXV_API_TIMEOUTAPI request timeout in seconds30

When NXV_API_URL is set, nxv will query the remote server instead of the local database. This is useful for CI/CD environments where you don't want to download the index.

Index Updates

VariableDescriptionDefault
NXV_MANIFEST_URLCustom manifest URL for index downloadsGitHub releases
NXV_PUBLIC_KEYCustom public key for manifest verificationBuilt-in key
NXV_SKIP_VERIFYSkip manifest signature verificationfalse
NXV_NO_SELF_UPDATESkip the binary self-update check in nxv updateNot set

By default, nxv update checks GitHub for a newer nxv release after refreshing the index. Set NXV_NO_SELF_UPDATE (or pass --no-self-update) to only refresh the index.

Server

VariableDescriptionDefault
NXV_HOSTServer bind address127.0.0.1
NXV_PORTServer listen port8080
NXV_RATE_LIMITRate limit per IP (requests/sec)None
NXV_RATE_LIMIT_BURSTRate limit burst size2x rate
NXV_MAX_DB_CONNECTIONSMaximum concurrent database operations32
NXV_DB_TIMEOUT_SECSPer-operation database timeout in seconds30
NXV_LOG_FORMATSet to json for structured logs (combine with RUST_LOG)Plain text
NXV_FRONTEND_DIRServe frontend assets from this directory (disables 24h cache)Embedded

NXV_FRONTEND_DIR is intended for development: set it to the checkout's frontend/ directory and edits to index.html, app.js, or favicon.svg are picked up on the next request without rebuilding. Leave unset in production to serve the embedded copy with a 24h Cache-Control.

Indexing & Publishing

These only apply to builds with the indexer feature:

VariableDescriptionDefault
NXV_SECRET_KEYMinisign secret key (path or contents) for nxv publishNone
NXV_RELEASES_URLOverride the releases.nixos.org endpoint for nxv indexreleases.nixos.org

Output

VariableDescriptionDefault
NO_COLORDisable colored outputNot set

Data Directories

nxv stores data in platform-specific directories:

PlatformPath
Linux~/.local/share/nxv/
macOS~/Library/Application Support/nxv/

Files stored:

  • index.db - SQLite database with package versions
  • bloom.bin - Bloom filter for fast negative lookups

Example Configurations

CI/CD (Remote API)

bash
export NXV_API_URL="https://nxv.example.com"
nxv search python --version 3.11

Custom Index Location

bash
export NXV_DB_PATH="/data/nxv/index.db"
nxv update

Released under the MIT License.