mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-01-11 09:44:08 -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
|
# Quadlets
|
||||||
"modules/quadlets"
|
"modules/quadlets"
|
||||||
"modules/quadlets/booklore"
|
"modules/quadlets/booklore"
|
||||||
|
"modules/quadlets/frigate"
|
||||||
|
|
||||||
# Hosted services
|
# Hosted services
|
||||||
"modules/services/mealie"
|
"modules/services/mealie"
|
||||||
"modules/services/actualbudget"
|
"modules/services/actualbudget"
|
||||||
"modules/services/frigate"
|
# "modules/services/frigate"
|
||||||
"modules/services/homepage"
|
"modules/services/homepage"
|
||||||
"modules/services/mqtt"
|
"modules/services/mqtt"
|
||||||
"modules/services/lubelogger"
|
"modules/services/lubelogger"
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,14 @@
|
||||||
let
|
|
||||||
volumePath = "/overseer/services";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
inputs,
|
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
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" (
|
frigateConfig = pkgs.writeText "frigate-config.yaml" (
|
||||||
lib.generators.toYAML { } {
|
lib.generators.toYAML { } {
|
||||||
auth.enabled = false; # Proxy auth
|
auth.enabled = false; # Proxy auth
|
||||||
|
|
@ -48,18 +47,6 @@ let
|
||||||
wce-0002_sub = [
|
wce-0002_sub = [
|
||||||
"rtsp://thingino:thingino@192.168.150.2:554/ch1"
|
"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;
|
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"
|
"d ${volumePath}/frigate/db"
|
||||||
"f ${volumePath}/frigate/db/frigate.db"
|
"f ${volumePath}/frigate/db/frigate.db"
|
||||||
];
|
];
|
||||||
###########
|
|
||||||
# Service #
|
|
||||||
###########
|
|
||||||
|
|
||||||
virtualisation.oci-containers = {
|
virtualisation.quadlet = {
|
||||||
backend = "podman";
|
|
||||||
containers = {
|
containers = {
|
||||||
"frigate" = {
|
frigate.containerConfig = {
|
||||||
image = "ghcr.io/blakeblackshear/frigate:0.17.0-beta1";
|
image = "ghcr.io/blakeblackshear/frigate:0.17.0-beta1";
|
||||||
environmentFiles = [ config.sops.templates."frigate_env".path ];
|
environmentFiles = [ config.sops.templates."frigate_env".path ];
|
||||||
|
devices = [
|
||||||
|
"/dev/bus/usb:/dev/bus/usb"
|
||||||
|
];
|
||||||
|
shmSize = "612m";
|
||||||
volumes = [
|
volumes = [
|
||||||
"/etc/localtime:/etc/localtime:ro"
|
"/etc/localtime:/etc/localtime:ro"
|
||||||
"${volumePath}/frigate/media/frigate:/media/frigate"
|
"${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"
|
"${volumePath}/frigate/db/frigate.db:/config/frigate.db"
|
||||||
];
|
];
|
||||||
extraOptions = [
|
publishPorts = [
|
||||||
"--shm-size=612m"
|
"${securePort}:8971"
|
||||||
"--ip=10.88.0.10"
|
|
||||||
];
|
|
||||||
devices = [
|
|
||||||
"/dev/bus/usb:/dev/bus/usb"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -251,7 +194,7 @@ in
|
||||||
}
|
}
|
||||||
route /* {
|
route /* {
|
||||||
authorize with frigate
|
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