nats
Options
Section titled “Options”services.nats.enable
Section titled “services.nats.enable”Whether to enable the NATS messaging server.
NATS is a simple, secure and high performance messaging system for cloud native applications, IoT messaging, and microservices architectures.
Type: boolean
Default:
falseDeclared by:
services.nats.package
Section titled “services.nats.package”Which NATS server package to use.
Type: package
Default:
pkgs.nats-serverDeclared by:
services.nats.authorization.enable
Section titled “services.nats.authorization.enable”Whether to enable authorization for client connections.
Type: boolean
Default:
falseExample:
trueDeclared by:
services.nats.authorization.password
Section titled “services.nats.authorization.password”Password required for client connections. Only used if authorization is enabled. Warning: This will be visible in the Nix store.
Type: string
Default:
""Example:
"nats-pass"Declared by:
services.nats.authorization.token
Section titled “services.nats.authorization.token”Token required for client connections. Alternative to user/password authentication. Warning: This will be visible in the Nix store.
Type: string
Default:
""Example:
"my-secret-token"Declared by:
services.nats.authorization.user
Section titled “services.nats.authorization.user”Username required for client connections. Only used if authorization is enabled.
Type: string
Default:
""Example:
"nats-user"Declared by:
services.nats.clientAdvertise
Section titled “services.nats.clientAdvertise”Client URL to advertise to other servers in a cluster. Useful when running behind NAT or in containers.
Type: string
Default:
""Example:
"localhost:4222"Declared by:
services.nats.debug
Section titled “services.nats.debug”Enable debug logging for troubleshooting.
Type: boolean
Default:
falseDeclared by:
services.nats.host
Section titled “services.nats.host”Network host to listen on for client connections. Set to “0.0.0.0” to listen on all interfaces. Default is localhost for security.
Type: string
Default:
"127.0.0.1"Example:
"0.0.0.0"Declared by:
services.nats.jetstream.enable
Section titled “services.nats.jetstream.enable”Whether to enable JetStream persistence layer for streaming and queues.
Type: boolean
Default:
falseExample:
trueDeclared by:
services.nats.jetstream.maxFileStore
Section titled “services.nats.jetstream.maxFileStore”Maximum disk space for file-based streams. Use suffixes: K, M, G, T for sizes.
Type: string
Default:
"10G"Example:
"100G"Declared by:
services.nats.jetstream.maxMemory
Section titled “services.nats.jetstream.maxMemory”Maximum memory for in-memory streams. Use suffixes: K, M, G, T for sizes.
Type: string
Default:
"1G"Example:
"512M"Declared by:
services.nats.logFile
Section titled “services.nats.logFile”Path to log file. If empty, logs to stdout. Stdout is recommended for devenv as logs are captured by process manager.
Type: string
Default:
""Example:
"/var/log/nats-server.log"Declared by:
services.nats.monitoring.enable
Section titled “services.nats.monitoring.enable”Enable HTTP monitoring endpoint. Provides /healthz, /varz, /connz, and other monitoring endpoints. Highly recommended for production deployments.
Type: boolean
Default:
trueDeclared by:
services.nats.monitoring.port
Section titled “services.nats.monitoring.port”Port for HTTP monitoring endpoint.
Access monitoring at http://host:port/varz
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
8222Declared by:
services.nats.port
Section titled “services.nats.port”Port to listen on for client connections.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
4222Declared by:
services.nats.serverName
Section titled “services.nats.serverName”Server name for identification in clusters. If empty, NATS will auto-generate a unique name.
Type: string
Default:
""Example:
"nats-dev-1"Declared by:
services.nats.settings
Section titled “services.nats.settings”Additional NATS server configuration as a Nix attribute set. This will be converted to NATS config file format.
Use this for advanced features like:
- TLS/SSL configuration
- Clustering with routes
- MQTT gateway
- WebSocket support
- Custom authorization
See https://docs.nats.io/running-a-nats-service/configuration
Type: attribute set
Default:
{ }Example:
{ tls = { cert_file = "/path/to/cert.pem"; key_file = "/path/to/key.pem"; verify = true; }; cluster = { name = "my-cluster"; listen = "0.0.0.0:6222"; routes = [ "nats://node1:6222" "nats://node2:6222" ]; };}Declared by:
services.nats.trace
Section titled “services.nats.trace”Enable protocol tracing for deep debugging. Warning: Very verbose output.
Type: boolean
Default:
falseDeclared by:

