Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Control Plane Options

All options under services.nixfleet-control-plane. The module is auto-included by mkHost and disabled by default.

Options

OptionTypeDefaultDescription
enableboolfalseEnable the NixFleet control plane server.
listenstr"0.0.0.0:8080"Address and port to listen on.
dbPathstr"/var/lib/nixfleet-cp/state.db"Path to the SQLite state database.
openFirewallboolfalseOpen the control plane port in the firewall. The port is parsed from the listen value.
tls.certnullOr strnullPath to TLS certificate PEM file. Enables HTTPS when set (requires tls.key). Example: "/run/secrets/cp-cert.pem".
tls.keynullOr strnullPath to TLS private key PEM file. Example: "/run/secrets/cp-key.pem".
tls.clientCanullOr strnullPath to client CA PEM file. When set, all TLS connections must present a valid client certificate signed by this CA (required mTLS). Admin clients must present both a client cert and an API key. Example: "/run/secrets/fleet-ca.pem".

Prometheus Metrics

The control plane exposes a GET /metrics endpoint on its listen address. No separate port or additional configuration is required - the endpoint is always available when the service is running.

No authentication is required for /metrics (same as /health). Restrict access at the network level if needed.

Metrics exposed:

MetricDescription
nixfleet_fleet_sizeTotal number of registered machines
nixfleet_machines_by_lifecycleMachine count grouped by lifecycle state (label: lifecycle)
nixfleet_machine_last_seen_timestamp_secondsUnix timestamp of each machine’s last report (label: machine_id)
nixfleet_http_requests_totalHTTP request count by method, path, and status code
nixfleet_http_request_duration_secondsHTTP request latency histogram
nixfleet_rollouts_totalRollout count by status (label: status)
nixfleet_rollouts_activeNumber of currently active rollouts (created, running, or paused)

Example:

curl http://localhost:8080/metrics

Systemd service

SettingValue
Targetmulti-user.target
Afternetwork-online.target
Restartalways (10s delay)
StateDirectorynixfleet-cp
NoNewPrivilegestrue
ProtectHometrue
PrivateTmptrue
PrivateDevicestrue
ProtectKernelTunablestrue
ProtectKernelModulestrue
ProtectControlGroupstrue
ReadWritePaths/var/lib/nixfleet-cp

Example

services.nixfleet-control-plane = {
  enable = true;
  listen = "0.0.0.0:8080";
  openFirewall = true;
};

On impermanent hosts, /var/lib/nixfleet-cp is automatically persisted.