51 lines
1.4 KiB
Nix
51 lines
1.4 KiB
Nix
{ 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;
|
|
image = "blakeblackshear/frigate:0.11.1";
|
|
ports = [
|
|
"5000:5000"
|
|
];
|
|
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"
|
|
];
|
|
environmentFiles = [
|
|
config.sops.secrets.frigate.path
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|