Skip to content
Nix
Browse Nix

Configuration

Updated
On this page

With Docker Compose, all production settings live in one private environment file, based on deploy/compose.prod.env.example. Keep it outside the repository checkout with mode 0600, and preserve its passwords, keys and identity settings across upgrades. Changing a key later can invalidate stored state.

Images#

Variable

Purpose

NIX_IMAGE_REGISTRY

Optional. Defaults to ghcr.io/sianachi/nix. Set localhost/nix only for images built on the host

NIX_IMAGE_TAG

The full commit SHA of the release for the API, migrator, Node (collaboration, companion and sites worker), sites and release-tools images

NIX_WEB_IMAGE_TAG

The full commit SHA for the web image

The release script exports the tags in the shell, which takes precedence over the file, so you do not edit the file per release.

Database#

Variable

Purpose

NIX_PG_SUPERUSER_PASSWORD

The PostgreSQL superuser password

NIX_PG_MIGRATOR_PASSWORD

The nix_migrator password

NIX_MIGRATOR_CONNECTION_STRING

Core migrations, as nix_migrator

NIX_CORE_DATABASE_URL

Core at runtime, as nix_app

NIX_COLLAB_DATABASE_URL

Collaboration at runtime, as nix_collab

NIX_COLLAB_MIGRATOR_CONNECTION_STRING

Document migrations, as nix_migrator. Used only by the one-shot job

NIX_CORE_DATABASE_URL=Host=postgres;Port=5432;Database=nix;Username=nix_app;Password=<app-password>
NIX_COLLAB_DATABASE_URL=postgresql://nix_collab:<collab-password>@postgres:5432/nix

Internal secrets#

Variable

Purpose

NIX_INTERNAL_SECRET

Authenticates internal calls between services

NIX_PUBLIC_FORMS_SIGNING_KEY

Signs interactive form links

Generate each with a strong random value, for example openssl rand -base64 48.

Object storage#

Variable

Purpose

NIX_OBJECT_STORE_ENDPOINT

The S3 endpoint Core and the workers use

NIX_OBJECT_STORE_PUBLIC_ORIGIN

The origin browsers use for signed links

NIX_OBJECT_STORE_REGION

Defaults to us-east-1

NIX_OBJECT_STORE_BUCKET

The bucket name

NIX_OBJECT_STORE_ACCESS_KEY, NIX_OBJECT_STORE_SECRET_KEY

Storage credentials

With the bundled store, set both the endpoint and the public origin to https://<your-domain>; the web container routes the bucket path to the store. The bucket name becomes a path on your domain, so it must not match one of the app's own pages.

Sign-in#

Pick one mode per install. There is no account linking between them.

Variable

Purpose

NIX_PUBLIC_ORIGIN

https://<your-domain>

NIX_AUTH_MODE

local: Core signs people in itself, with passwords, passkeys and authenticator codes. oidc: an outside identity provider. Unset means oidc when NIX_OIDC_ISSUER is set and local otherwise

NIX_AUTH_SETUP_CODE

Local mode. The code the first-run page at /setup asks for. The person who uses it becomes the administrator. Generate one yourself, for example openssl rand -hex 16

NIX_AUTH_PASSKEY_RP_ID

Local mode. The hostname passkeys are bound to. Defaults to the public origin's host. Set it only when migrating passkeys created for another hostname, and serve /.well-known/webauthn on that host

NIX_OIDC_ISSUER

Your identity provider's issuer URL. Empty in local mode

NIX_OIDC_CLIENT_ID

The OIDC client ID for Nix. Empty in local mode

NIX_OIDC_ACCOUNT_URL

Optional. The provider's self-service account page. Defaults to the issuer's /ui/console/users/me?id=security page

NIX_COLLAB_OIDC_ISSUERS

Which token issuers the collaboration service trusts. In local mode set it to <NIX_CORE_TOKEN_ISSUER>|http://nix-api:8080/public/v1/auth/jwks

NIX_COLLAB_OIDC_AUDIENCE

In local mode set it to the value of NIX_CORE_TOKEN_AUDIENCE

NIX_BOOTSTRAP_IDENTITY

Read by deploy/compose/deploy.sh, not the file. true creates the first tenant and identity provider for a fresh install that uses an outside provider. Needs NIX_BOOTSTRAP_TENANT_NAME and NIX_BOOTSTRAP_OIDC_PROJECT_ID; NIX_BOOTSTRAP_TENANT_ID is optional. Local mode never needs it

Compose refuses to start with NIX_OIDC_ISSUER or NIX_OIDC_CLIENT_ID unset, so a local-mode install sets both to empty values. An install in local mode refuses tokens from an outside identity provider.

Access tokens#

Nix issues its own short-lived access tokens to browsers, nixctl and personal access tokens.

Variable

Purpose

NIX_CORE_TOKEN_ISSUER

Usually https://<your-domain>

NIX_CORE_TOKEN_AUDIENCE

Usually nix

NIX_CORE_TOKEN_KEY_ID

A name for the signing key, such as nix-core-2026-10

NIX_CORE_TOKEN_SIGNING_KEY_FILE

Absolute path to the P-256 private key

openssl ecparam -name prime256v1 -genkey -noout -out core-access-token.pem

Generate the key once and keep it.

Push notifications#

Variable

Purpose

NIX_PUSH_VAPID_PRIVATE_KEY

The VAPID private key: 32 raw bytes, base64url, no padding

NIX_PUSH_VAPID_PUBLIC_KEY

The matching public key: an uncompressed P-256 point, base64url

NIX_PUSH_VAPID_SUBJECT

A mailto: or https: contact for push services

Generate one key pair for the lifetime of the deployment. Changing it means every device has to subscribe again.

Calendar sync#

Optional. A provider without a client ID and secret is shown as unavailable.

Variable

Purpose

NIX_CALENDAR_GOOGLE_CLIENT_ID, NIX_CALENDAR_GOOGLE_CLIENT_SECRET

Google OAuth application

NIX_CALENDAR_MICROSOFT_CLIENT_ID, NIX_CALENDAR_MICROSOFT_CLIENT_SECRET

Microsoft OAuth application

NIX_CALENDAR_MICROSOFT_TENANT

Defaults to common

Register these redirect URIs with the provider:

https://<your-domain>/auth/calendar/callback/google
https://<your-domain>/auth/calendar/callback/microsoft

Core keeps calendar refresh tokens encrypted with its data-protection keys, which live in the nix-api-data-protection volume. Back that volume up separately from the database. If it is lost, every calendar connection has to be made again.

Remote MCP#

Optional. Add mcp to COMPOSE_PROFILES to run the MCP service. The one-line installer always runs it.

Variable

Purpose

NIX_MCP_UPSTREAM

Where the web container proxies /mcp, for example nix-mcp:8500. Unset, the route fails closed

NIX_MCP_PUBLIC_URL

The public address, https://<your-domain>/mcp. Core shows it in Settings, and hosted clients such as Claude and ChatGPT sign in through Core's OAuth routes. Those routes answer 404 unless this and NIX_PUBLIC_ORIGIN are both set

Variable

Purpose

NIX_PUBLIC_LINKS_ENABLED

Set to true to let people share notes and files by public link. Defaults to false. Links are signed with NIX_PUBLIC_FORMS_SIGNING_KEY

Companion#

Variable

Purpose

NIX_PETS_SERVER_TOOLS

Core's switch for server-side companion tools: off, reads or all. Defaults to off. It is the kill switch: turn the companion's switch on first, then this one

NIX_COMPANION_SERVER_TOOLS

The companion runtime's matching switch, off, reads or all. Defaults to off

NIX_PET_RUNS_ENABLED

Set to true for companion jobs in one pilot workspace. Defaults to false

NIX_PET_RUNS_PILOT_WORKSPACE

The workspace ID jobs are limited to

NIX_PET_BROWSER_URL, NIX_PET_BROWSER_INTERNAL_SECRET

The optional browser worker (the pet-browser profile) and the random secret shared by it and Core

NIX_PET_GOOGLE_, NIX_PET_MICROSOFT_, NIX_PET_SLACK_, NIX_PET_GITHUB_, NIX_PET_LINEAR_*

CLIENT_ID and CLIENT_SECRET for each connection a companion can use. Register /auth/pet-connections/callback on the public origin. NIX_PET_MICROSOFT_TENANT defaults to organizations

Tunnel#

Variable

Purpose

CLOUDFLARE_TUNNEL_TOKEN

The token for the optional tunnel connector. Set a placeholder if you use your own reverse proxy

Sites#

Optional. Leave these unset and nothing about Sites runs.

Variable

Purpose

COMPOSE_PROFILES

Include sites to start the sites serving process. Separate several profiles with commas

NIX_SITES_ENABLED

Set to true to turn Sites on in Core. Defaults to false

NIX_SITES_DOMAIN

The domain sites are served under, as <slug>.<sites-domain>. It must not share a registrable domain with NIX_PUBLIC_ORIGIN

NIX_SITES_BUCKET

The bucket built sites are written to. Defaults to nix-sites

NIX_SITES_READ_ACCESS_KEY, NIX_SITES_READ_SECRET_KEY

The serving process's storage credential. Use a key that can only read the sites bucket where your store supports it

NIX_SITES_DEFAULT_LABEL_SUFFIX

Optional. A label suffix for this instance's default hostnames, as <slug><suffix>.<sites-domain>, when another deployment shares the sites domain

NIX_SITES_CLOUDFLARE_API_TOKEN

Optional. Lets Nix create DNS records and tunnel routes for site hostnames. Needs Zone:Read, DNS:Edit and Cloudflare Tunnel:Edit

NIX_SITES_CLOUDFLARE_ACCOUNT_ID, NIX_SITES_CLOUDFLARE_TUNNEL_ID

The account and tunnel those routes are added to

NIX_SITES_CLOUDFLARE_TUNNEL_SERVICE

Optional. The service the tunnel routes site hostnames to. Defaults to http://nix-sites-serve:8400

NIX_SITES_CLOUDFLARE_DEFAULT_HOSTNAME_ZONE_ID

The zone for this instance's default hostnames when a label suffix is set. Never used for custom hostnames

Release host#

deploy/compose/release.sh reads non-secret host settings from a release.conf file, found at NIX_RELEASE_CONF. Start from deploy/compose/release.conf.example. It holds NIX_DEPLOY_ENV (the absolute path to your environment file), NIXCTL_PROFILE and NIX_SMOKE_WORKSPACE for the smoke test, NIX_BACKUP_ROOT, NIX_OFFSITE_REQUIRED, NIX_RELEASE_LEDGER, NIX_RELEASE_LOCK and NIX_IMAGE_REGISTRY. Never put a password, token or key in it.

Kubernetes#

The Kubernetes manifests read the same settings from Secrets and ConfigMaps instead of an environment file. deploy/k8s/create-secrets.sh creates the Secrets and lists them as it goes; see Kubernetes. The settings passed to deploy/k8s/deploy.sh are:

Variable

Purpose

NIX_DEPLOY_TARGET

Must be kubernetes, or the script refuses to run

REGISTRY, TAG

Where the images are and the full commit SHA to run

DOMAIN

The app's domain, also used for sites

NIX_AUTH_MODE

local or oidc. Defaults to local for an empty namespace; set it explicitly on an existing install

OIDC_ISSUER, OIDC_CLIENT_ID

Both required when NIX_AUTH_MODE=oidc. Nothing deploys the provider

NIX_AUTH_PASSKEY_RP_ID

Optional. The hostname migrated passkeys were registered for. Defaults to auth.<DOMAIN> during a Zitadel import

NIX_IMPORT_ZITADEL

dry-run or run, to move an old bundled Zitadel install onto local sign-in. See Upgrades

NIX_TEMPLATE_BOOT_ENABLED

false on a first install; true requires the TEMPLATE_BOOT_* settings

NIX_MCP_ENABLED

Defaults to true. false removes remote MCP

NIX_PUBLIC_LINKS_ENABLED

Defaults to false

NIX_SITES_REQUIRE_OPERATOR_APPROVAL

Defaults to true

SITES_FOREIGN_LABEL_SUFFIX

Defaults to -home; set it empty when no other deployment shares the domain

NIX_BACKUP_OFFSITE

Defaults to false. true fails the nightly backup when the off-node secret is missing

POD_CIDR

Defaults to 10.42.0.0/16

INGRESS_CLASS, STORAGE_CLASS, STORAGE_CLASS_RETAIN, TLS_HOSTS, NIX_INGRESS_CLOUDFLARE_ONLY

For clusters other than the k3s and Cloudflare defaults

The inputs to create-secrets.sh include DOMAIN, the NIX_OBJECT_STORE_* and NIX_CALENDAR_* values, NIX_SITES_BUCKET and NIX_SITES_READ_*, the optional NIX_SITES_CLOUDFLARE_* values, NIX_PUSH_VAPID_*, NIX_ORIGIN_TLS_CERT_FILE, NIX_ORIGIN_TLS_KEY_FILE and the optional NIX_AUTH_SETUP_CODE. --backup-offsite-only reads RESTIC_REPOSITORY, RESTIC_PASSWORD, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. Passwords for the database, internal secret and signing keys are generated.