Runtime configuration
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
| Setting | Environment variable | CLI option | Default or description |
|---|---|---|---|
config | NIX_PINS_CONFIG | --config PATH | ./pins-config.nix |
file | NIX_PINS_FILE | --pins PATH | ./pins.json |
nixpkgs | NIX_PINS_NIXPKGS | --nixpkgs PATH_OR_FLAKE | Optional local path or flake reference (e.g. flake:nixpkgs) evaluated instead of <nixpkgs> |
system | NIX_PINS_SYSTEM | --system SYSTEM | Optional target Nix system (e.g. aarch64-linux); defaults to host system |
download_jobs | NIX_PINS_DOWNLOAD_JOBS | --download-jobs N | 2 |
checker_jobs | NIX_PINS_CHECKER_JOBS | --checker-jobs N | Half the available logical CPU count, rounded down, at least 1 |
hash_jobs | NIX_PINS_HASH_JOBS | --hash-jobs N | Same as above |
refresh_dependencies | NIX_PINS_REFRESH_DEPENDENCIES | --refresh-dependencies | false |
refresh_sources | NIX_PINS_REFRESH_SOURCES | --refresh-sources | false |
github_api_base | NIX_PINS_GITHUB_API_BASE | --github-api-base URL | Official GitHub API |
gitlab_api_base | NIX_PINS_GITLAB_API_BASE | --gitlab-api-base URL | Official GitLab API v4 (https://gitlab.com/api/v4) |
gitea_api_base | NIX_PINS_GITEA_API_BASE | --gitea-api-base URL | Optional Gitea/Forgejo API v1 base URL override |
oci_registry_base | NIX_PINS_OCI_REGISTRY_BASE | --oci-registry-base URL | Optional OCI registry base URL override |
http_timeout_secs | NIX_PINS_HTTP_TIMEOUT | --http-timeout SECONDS | 30 (must be positive) |
http_retries | NIX_PINS_HTTP_RETRIES | --http-retries N | 3 (0–10) |
crates_api_base | NIX_PINS_CRATES_API_BASE | --crates-api-base URL | Official crates.io API |
pypi_api_base | NIX_PINS_PYPI_API_BASE | --pypi-api-base URL | Official PyPI API |
npm_registry_base | NIX_PINS_NPM_REGISTRY_BASE | --npm-registry-base URL | Official npm registry |
github_token | NIX_PINS_GITHUB_TOKEN | --github-token TOKEN | Optional GitHub token (GITHUB_TOKEN fallback; reused for ghcr.io) |
gitlab_token | NIX_PINS_GITLAB_TOKEN | --gitlab-token TOKEN | Optional GitLab token (GITLAB_TOKEN fallback; reused for registry.gitlab.com) |
gitea_token | NIX_PINS_GITEA_TOKEN | --gitea-token TOKEN | Optional Gitea/Forgejo token (GITEA_TOKEN fallback) |
oci_token | NIX_PINS_OCI_TOKEN | --oci-token TOKEN | Optional 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.