mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
frigate init
This commit is contained in:
parent
d30996fac4
commit
cbfb9c30a0
2 changed files with 110 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
modules.system = {
|
modules.system = {
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
forgejo.enable = true;
|
forgejo.enable = true;
|
||||||
|
frigate.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users = {
|
users.users = {
|
||||||
|
|
|
||||||
109
src/system/modules/frigate/default.nix
Normal file
109
src/system/modules/frigate/default.nix
Normal file
|
|
@ -0,0 +1,109 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.system.frigate;
|
||||||
|
nginx = config.modules.system.nginx;
|
||||||
|
domain = "ramos.codes";
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.modules.system.frigate = {
|
||||||
|
enable = mkEnableOption "Enable Frigate NVR";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.frigate = {
|
||||||
|
enable = true;
|
||||||
|
hostname = "frigate.${domain}";
|
||||||
|
settings = {
|
||||||
|
web = {
|
||||||
|
bind_address = "127.0.0.1";
|
||||||
|
port = 5000;
|
||||||
|
};
|
||||||
|
mqtt.enabled = false;
|
||||||
|
cameras = {
|
||||||
|
"Doorbell" = {
|
||||||
|
ffmpeg = {
|
||||||
|
inputs = [
|
||||||
|
{
|
||||||
|
path = "rtsp://admin:ocu?u3Su@192.168.0.134/cam/realmonitor?channel=1&subtype=0";
|
||||||
|
roles = [ "record" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
path = "rtsp://admin:ocu?u3Su@192.168.0.134/cam/realmonitor?channel=1&subtype=1";
|
||||||
|
roles = [ "detect" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"Living Room" = {
|
||||||
|
ffmpeg = {
|
||||||
|
inputs = [
|
||||||
|
{
|
||||||
|
path = "rtsp://admin:ocu?u3Su@192.168.0.181/cam/realmonitor?channel=1&subtype=0";
|
||||||
|
roles = [ "record" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
path = "rtsp://admin:ocu?u3Su@192.168.0.181/cam/realmonitor?channel=1&subtype=1";
|
||||||
|
roles = [ "detect" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"Kitchen" = {
|
||||||
|
ffmpeg = {
|
||||||
|
inputs = [
|
||||||
|
{
|
||||||
|
path = "rtsp://admin:ocu?u3Su@192.168.0.181/cam/realmonitor?channel=2&subtype=0";
|
||||||
|
roles = [ "record" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
path = "rtsp://admin:ocu?u3Su@192.168.0.181/cam/realmonitor?channel=2&subtype=1";
|
||||||
|
roles = [ "detect" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"Parking Lot" = {
|
||||||
|
ffmpeg = {
|
||||||
|
inputs = [
|
||||||
|
{
|
||||||
|
path = "rtsp://admin:ocu?u3Su@192.168.0.60/cam/realmonitor?channel=1&subtype=0";
|
||||||
|
roles = [ "record" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
path = "rtsp://admin:ocu?u3Su@192.168.0.60/cam/realmonitor?channel=1&subtype=1";
|
||||||
|
roles = [ "detect" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"Porch" = {
|
||||||
|
ffmpeg = {
|
||||||
|
inputs = [
|
||||||
|
{
|
||||||
|
path = "rtsp://admin:ocu?u3Su@192.168.0.108/cam/realmonitor?channel=1&subtype=0";
|
||||||
|
roles = [ "record" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
path = "rtsp://admin:ocu?u3Su@192.168.0.108/cam/realmonitor?channel=1&subtype=1";
|
||||||
|
roles = [ "detect" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."frigate.${domain}" = mkIf nginx.enable {
|
||||||
|
useACMEHost = domain;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:5000";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue