mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-01-10 01:24:05 -05:00
frigate to quadlet
This commit is contained in:
parent
79b6c4c0c1
commit
9e13f06027
2 changed files with 17 additions and 73 deletions
|
|
@ -42,11 +42,12 @@
|
|||
# Quadlets
|
||||
"modules/quadlets"
|
||||
"modules/quadlets/booklore"
|
||||
"modules/quadlets/frigate"
|
||||
|
||||
# Hosted services
|
||||
"modules/services/mealie"
|
||||
"modules/services/actualbudget"
|
||||
"modules/services/frigate"
|
||||
# "modules/services/frigate"
|
||||
"modules/services/homepage"
|
||||
"modules/services/mqtt"
|
||||
"modules/services/lubelogger"
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
let
|
||||
volumePath = "/overseer/services";
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
sopsFolder = builtins.toString inputs.nix-secrets + "/sops";
|
||||
securePort = builtins.toString (lib.custom.autoport "frigate-secure");
|
||||
volumePath = "/overseer/services";
|
||||
sopsFolder = inputs.nix-secrets + "/sops";
|
||||
frigateConfig = pkgs.writeText "frigate-config.yaml" (
|
||||
lib.generators.toYAML { } {
|
||||
auth.enabled = false; # Proxy auth
|
||||
|
|
@ -48,18 +47,6 @@ let
|
|||
wce-0002_sub = [
|
||||
"rtsp://thingino:thingino@192.168.150.2:554/ch1"
|
||||
];
|
||||
wce-0003 = [
|
||||
"rtsp://thingino:thingino@192.168.150.3:554/ch0"
|
||||
];
|
||||
wce-0003_sub = [
|
||||
"rtsp://thingino:thingino@192.168.150.3:554/ch1"
|
||||
];
|
||||
#wce-0004 = [
|
||||
# "rtsp://192.168.0.210:554/media/live/1/1"
|
||||
# ];
|
||||
# wce-0004_sub = [
|
||||
# "rtsp://192.168.0.210:554/media/live/1/2"
|
||||
# ];
|
||||
};
|
||||
};
|
||||
#############
|
||||
|
|
@ -151,46 +138,6 @@ let
|
|||
};
|
||||
detect.enabled = true;
|
||||
};
|
||||
wce-0003 = {
|
||||
ffmpeg = {
|
||||
inputs = [
|
||||
{
|
||||
path = "rtsp://127.0.0.1:8554/wce-0003";
|
||||
roles = [ "record" ];
|
||||
}
|
||||
{
|
||||
path = "rtsp://127.0.0.1:8554/wce-0003_sub";
|
||||
roles = [ "detect" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
motion = {
|
||||
enabled = true;
|
||||
mask = [
|
||||
"0,0,0.196,0.002,0.195,0.045,0,0.043" # timestamp
|
||||
"0.898,0,0.896,0.045,1,0.048,0.999,0.002" # uptime
|
||||
];
|
||||
};
|
||||
detect.enabled = true;
|
||||
};
|
||||
# wce-0004 = {
|
||||
# ffmpeg = {
|
||||
# inputs = [
|
||||
# {
|
||||
# path = "rtsp://127.0.0.1:8554/wce-0004";
|
||||
# roles = ["record"];
|
||||
# }
|
||||
# {
|
||||
# path = "rtsp://127.0.0.1:8554/wce-0004_sub";
|
||||
# roles = ["detect"];
|
||||
# }
|
||||
# ];
|
||||
# };
|
||||
# motion = {
|
||||
# enabled = true;
|
||||
# };
|
||||
# detect.enabled = true;
|
||||
# };
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
@ -212,28 +159,24 @@ in
|
|||
"d ${volumePath}/frigate/db"
|
||||
"f ${volumePath}/frigate/db/frigate.db"
|
||||
];
|
||||
###########
|
||||
# Service #
|
||||
###########
|
||||
|
||||
virtualisation.oci-containers = {
|
||||
backend = "podman";
|
||||
virtualisation.quadlet = {
|
||||
containers = {
|
||||
"frigate" = {
|
||||
frigate.containerConfig = {
|
||||
image = "ghcr.io/blakeblackshear/frigate:0.17.0-beta1";
|
||||
environmentFiles = [ config.sops.templates."frigate_env".path ];
|
||||
devices = [
|
||||
"/dev/bus/usb:/dev/bus/usb"
|
||||
];
|
||||
shmSize = "612m";
|
||||
volumes = [
|
||||
"/etc/localtime:/etc/localtime:ro"
|
||||
"${volumePath}/frigate/media/frigate:/media/frigate"
|
||||
"${frigateConfig}:/config/config.yaml" # :ro to set to readonly
|
||||
"${frigateConfig}:/config/config.yaml:ro" # :ro to set to readonly
|
||||
"${volumePath}/frigate/db/frigate.db:/config/frigate.db"
|
||||
];
|
||||
extraOptions = [
|
||||
"--shm-size=612m"
|
||||
"--ip=10.88.0.10"
|
||||
];
|
||||
devices = [
|
||||
"/dev/bus/usb:/dev/bus/usb"
|
||||
publishPorts = [
|
||||
"${securePort}:8971"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
@ -251,7 +194,7 @@ in
|
|||
}
|
||||
route /* {
|
||||
authorize with frigate
|
||||
reverse_proxy http://10.88.0.10:8971
|
||||
reverse_proxy http://localhost:${securePort}
|
||||
}
|
||||
'';
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue