Reference

Runtime configuration

nix-pins.toml, environment variables, paths, and concurrency settings.

Runtime settings have the following precedence, from lowest to highest: defaults → optional nix-pins.toml in the current directory → NIX_PINS_* environment variables → CLI arguments. Configuration fields, CLI arguments, and environment variables are declared once in Settings. Clap reads CLI arguments and environment variables; config-rs merges TOML with explicitly supplied values from ArgMatches; Serde fills in missing defaults. Pin declarations remain in pins-config.nix.

config = "./pins-config.nix"
file = "./pins.json"
download_jobs = 2
checker_jobs = 4
hash_jobs = 4

Fields

SettingEnvironment variableCLI optionDefault or description
configNIX_PINS_CONFIG--config PATH./pins-config.nix
fileNIX_PINS_FILE--pins PATH./pins.json
nixpkgsNIX_PINS_NIXPKGS--nixpkgs PATH_OR_FLAKEOptional local path or flake reference (e.g. flake:nixpkgs) evaluated instead of <nixpkgs>
systemNIX_PINS_SYSTEM--system SYSTEMOptional target Nix system (e.g. aarch64-linux); defaults to host system
download_jobsNIX_PINS_DOWNLOAD_JOBS--download-jobs N2
checker_jobsNIX_PINS_CHECKER_JOBS--checker-jobs NHalf the available logical CPU count, rounded down, at least 1
hash_jobsNIX_PINS_HASH_JOBS--hash-jobs NSame as above
refresh_dependenciesNIX_PINS_REFRESH_DEPENDENCIES--refresh-dependenciesfalse
refresh_sourcesNIX_PINS_REFRESH_SOURCES--refresh-sourcesfalse
github_api_baseNIX_PINS_GITHUB_API_BASE--github-api-base URLOfficial GitHub API
gitlab_api_baseNIX_PINS_GITLAB_API_BASE--gitlab-api-base URLOfficial GitLab API v4 (https://gitlab.com/api/v4)
gitea_api_baseNIX_PINS_GITEA_API_BASE--gitea-api-base URLOptional Gitea/Forgejo API v1 base URL override
oci_registry_baseNIX_PINS_OCI_REGISTRY_BASE--oci-registry-base URLOptional OCI registry base URL override
http_timeout_secsNIX_PINS_HTTP_TIMEOUT--http-timeout SECONDS30 (must be positive)
http_retriesNIX_PINS_HTTP_RETRIES--http-retries N3 (0–10)
crates_api_baseNIX_PINS_CRATES_API_BASE--crates-api-base URLOfficial crates.io API
pypi_api_baseNIX_PINS_PYPI_API_BASE--pypi-api-base URLOfficial PyPI API
npm_registry_baseNIX_PINS_NPM_REGISTRY_BASE--npm-registry-base URLOfficial npm registry
github_tokenNIX_PINS_GITHUB_TOKEN--github-token TOKENOptional GitHub token (GITHUB_TOKEN fallback; reused for ghcr.io)
gitlab_tokenNIX_PINS_GITLAB_TOKEN--gitlab-token TOKENOptional GitLab token (GITLAB_TOKEN fallback; reused for registry.gitlab.com)
gitea_tokenNIX_PINS_GITEA_TOKEN--gitea-token TOKENOptional Gitea/Forgejo token (GITEA_TOKEN fallback)
oci_tokenNIX_PINS_OCI_TOKEN--oci-token TOKENOptional OCI token or user:pass (falls back to ~/.docker/config.json)

Concurrency values must be positive integers. Invalid configuration fails before Nix starts. Empty environment variables are treated as unset. GITHUB_TOKEN can also supply a token, with lower priority than the configuration file and NIX_PINS_GITHUB_TOKEN. Do not put tokens in configuration files committed to version control.

CLI options can appear before or after the subcommand. nix-pins update --help lists all settings, their environment variables, and default descriptions. Token environment variable values are not shown in help.

Concurrency queues

Each successful Checker immediately releases its Pin's next ready stages. Explicit references wait only for the required result and occupy no worker slot while waiting. Source downloads and original Source realization use download_jobs; all Nix evaluations, patches and dependency builds share hash_jobs. Source and Package tasks advance independently through these shared queues. Selective updates use locked startup inputs unless refresh_dependencies recursively includes prerequisites; see Dependencies between Pins.

Successful Pins immediately show ✔; failed Pins retain their previous results. A Pin updates only when every Source succeeds. Results are written together atomically at the end; cancellation writes nothing. Because downloads and builds can overlap, the overall phase is labeled Processing pins, with each node showing its specific step.

Increasing concurrency raises simultaneous network, Nix store, and CPU usage. If you encounter rate limits or local resource pressure, reduce the corresponding concurrency setting first.