2023-03-21 17:20:22 +01:00
|
|
|
{ config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.eboskma.services.frigate;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.eboskma.services.frigate = { enable = mkEnableOption "frigate"; };
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
# docker run -d \
|
|
|
|
# --name frigate \
|
|
|
|
# --restart=unless-stopped \
|
|
|
|
# --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \
|
|
|
|
# --device /dev/bus/usb:/dev/bus/usb \
|
|
|
|
# --device /dev/dri/renderD128 \
|
|
|
|
# --shm-size=64m \
|
|
|
|
# -v /path/to/your/storage:/media/frigate \
|
|
|
|
# -v /path/to/your/config.yml:/config/config.yml:ro \
|
|
|
|
# -v /etc/localtime:/etc/localtime:ro \
|
|
|
|
# -e FRIGATE_RTSP_PASSWORD='password' \
|
|
|
|
# -p 5000:5000 \
|
|
|
|
# -p 1935:1935 \
|
|
|
|
# blakeblackshear/frigate:stable
|
|
|
|
|
|
|
|
virtualisation.oci-containers.containers = {
|
|
|
|
frigate = {
|
|
|
|
autoStart = true;
|
2023-04-09 23:20:19 +02:00
|
|
|
image = "ghcr.io/blakeblackshear/frigate:0.12.0";
|
2023-03-21 17:20:22 +01:00
|
|
|
ports = [
|
|
|
|
"5000:5000"
|
2023-03-27 19:08:59 +02:00
|
|
|
"8554:8554" # RTSP feeds
|
|
|
|
"8555:8555/tcp" # WebRTC over tcp
|
|
|
|
"8555:8555/udp" # WebRTC over udp
|
2023-03-21 17:20:22 +01:00
|
|
|
];
|
|
|
|
volumes = [
|
|
|
|
"/etc/localtime:/etc/localtime:ro"
|
|
|
|
"${./config.yml}:/config/config.yml:ro"
|
|
|
|
"/data/frigate:/media/frigate"
|
|
|
|
];
|
|
|
|
extraOptions = [
|
|
|
|
# "--device" "/dev/bus/usb:/dev/bus/usb"
|
|
|
|
"--device"
|
|
|
|
"/dev/dri/renderD128"
|
|
|
|
"--shm-size=128m"
|
|
|
|
"--mount"
|
|
|
|
"type=tmpfs,target=/tmp/cache,tmpfs-size=1G"
|
|
|
|
];
|
2023-03-24 14:24:06 +01:00
|
|
|
environment = {
|
|
|
|
LIBVA_DRIVER_NAME = "i965";
|
|
|
|
};
|
2023-03-21 17:20:22 +01:00
|
|
|
environmentFiles = [
|
|
|
|
config.sops.secrets.frigate.path
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|