Skip to content

Configuration

All configuration is via environment variables. The daemon does not use CLI flags — os.Args is reserved for socket commands.

Variable Default Description
EMEET_PIXYD_STATE_DIR /run/emeet-pixyd Runtime state directory (socket + state.json)
EMEET_PIXYD_WEB_ADDR 127.0.0.1:8090 Web UI listen address (localhost only)
EMEET_PIXYD_POLL_INTERVAL 2s Call detection polling interval (Go duration)
EMEET_PIXYD_DEBOUNCE_COUNT 3 Consecutive polls before state change
EMEET_PIXYD_DEBUG false Enable pprof endpoints at /debug/pprof/
EMEET_PIXYD_AUTO full Auto mode: off, full, tracking-only, privacy-only
EMEET_PIXYD_DEFAULT_AUDIO nc Default audio mode: nc, live, org
EMEET_PIXYD_EXTRA_PRODUCT_IDS (empty) Comma-separated hex USB product IDs treated as PIXY-family variants (see Supported Devices)
EMEET_PIXYD_UPDATE_CHECK on Daily GitHub release check with an update notice (see below)

EMEET_PIXYD_POLL_INTERVAL accepts Go duration strings:

  • 2s — 2 seconds
  • 500ms — 500 milliseconds
  • 1m — 1 minute

EMEET_PIXYD_AUTO accepts legacy boolean values for backward compatibility:

  • true / 1 → full
  • false / 0 → off

Roughly 30 seconds after startup and then once a day, the daemon asks GitHub for the newest release (api.github.com/repos/LarsArtmann/emeet-pixyd/releases/latest, an unauthenticated GET — no version or identifying data is sent). When the running build predates that release, every surface shows a small notice:

  • the web panel footer renders a vX.Y.Z available link to the release page (morphed in live over SSE),
  • GET /api/status carries an additive update object ({version, url}, omitted when current),
  • emeet-pixyd version appends the tag and release URL,
  • the Waybar tooltip gains an Update available line.

Both build channels compare correctly: release binaries carry a semver tag (numeric compare), nix flake builds carry a git commit SHA (compared against the release tag via the GitHub compare API — only a commit strictly behind the tag counts). Dev builds (go run, version dev) never check. Set EMEET_PIXYD_UPDATE_CHECK=off to keep the daemon fully offline; failures are debug-logged only and never degrade anything.

Option Type Default Description
hardware.emeet-pixy.enable bool false Enable the daemon
hardware.emeet-pixy.user string "lars" User owning the runtime state directory
hardware.emeet-pixy.port port 8090 Web UI/API listen port (loopback-only)
hardware.emeet-pixy.auto enum "full" Auto-management strategy
hardware.emeet-pixy.defaultAudio enum "nc" Default audio mode
hardware.emeet-pixy.debug bool false Enable debug mode
hardware.emeet-pixy.updateCheck bool true Daily GitHub release check with an update notice (EMEET_PIXYD_UPDATE_CHECK)

The NixOS module passes all options as Environment= vars. The auto option maps directly to EMEET_PIXYD_AUTO, defaultAudio to EMEET_PIXYD_DEFAULT_AUDIO, and debug to EMEET_PIXYD_DEBUG. Setting updateCheck = false renders EMEET_PIXYD_UPDATE_CHECK=off.

hardware.emeet-pixy.port sets the TCP port for the web UI and control API and renders EMEET_PIXYD_WEB_ADDR=127.0.0.1:<port> in the unit. It deliberately has no host counterpart: the API has no authentication and exposes full webcam control (tracking, PTZ, presets, privacy), so the daemon binds loopback only. Anything beyond localhost goes through an authenticating reverse proxy — see Monitoring & Health for the security model and a proxy sketch.

Running without the NixOS module? EMEET_PIXYD_WEB_ADDR accepts any host:port — but keep it on 127.0.0.1 unless the listener sits behind auth.

The daemon persists state to {StateDir}/state.json. This includes:

  • Current camera mode
  • Audio mode
  • Gesture state
  • Auto mode
  • Saved PTZ presets

State is written atomically (.tmp file + rename). On startup, persisted state always wins over defaults.

The state file carries a schema version ("v" field). If the on-disk version differs from the current version, a warning is logged but the state is still loaded (best-effort backward compatibility).

The NixOS module applies systemd security hardening:

  • ProtectSystem=strict
  • PrivateTmp=true
  • NoNewPrivileges=true
  • RestrictAddressFamilies=[AF_UNIX AF_NETLINK AF_INET]
  • MemoryMax=256M
  • ReadWritePaths=["/run/emeet-pixyd"] (for socket file creation)

When EMEET_PIXYD_DEBUG=true (or hardware.emeet-pixy.debug = true):

  • pprof endpoints available at /debug/pprof/
  • More verbose logging

Config.Validate() checks all fields at startup:

  • AutoMode must be a valid enum value
  • DefaultAudio must be a valid enum value
  • StateDir must be non-empty
  • PollInterval must be positive
  • DebounceCount must be positive
  • WebAddr must be non-empty

Invalid configuration prevents the daemon from starting.