job "frigate" { # Pin to N150 LattePanda nodes - Intel UHD iGPU for OpenVINO-accelerated detection. # hardware.graphics (intel-compute-runtime) is deployed to these nodes via configuration.nix. constraint { attribute = "${node.class}" value = "latte-panda-n150" } group "frigate" { count = 1 network { port "http" { to = 5000 } } # Prestart: restore Frigate's SQLite DB from the Litestream file replica on the CIFS share. # Runs to completion before the frigate task starts. Safe on first boot (-if-replica-exists # is a no-op when no replica exists yet). task "litestream-restore" { lifecycle { hook = "prestart" sidecar = false } driver = "docker" config { image = "litestream/litestream:0.5.9" command = "restore" args = ["-if-replica-exists", "-config", "/local/litestream.yml", "/alloc/data/frigate.db"] } # Litestream config: replicate to /config/frigate.db.litestream/ on the CIFS share. # Litestream writes its own segment format - no SQLite advisory locking involved. # Frigate must be configured with database.path: /alloc/data/frigate.db in config.yml. template { data = <