This commit is contained in:
Bryan Ramos 2025-07-16 09:07:48 -04:00
parent beb00a5718
commit f1de6cf3ee
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
2 changed files with 68 additions and 38 deletions

View file

@ -8,6 +8,7 @@
system = { system = {
nginx.enable = true; nginx.enable = true;
forgejo.enable = true; forgejo.enable = true;
frigate.enable = true;
bitcoin = { bitcoin = {
enable = true; enable = true;
electrum.enable = true; electrum.enable = true;
@ -124,9 +125,5 @@
keyFile = "/var/lib/sops-nix/key.txt"; keyFile = "/var/lib/sops-nix/key.txt";
generateKey = true; generateKey = true;
}; };
secrets = {
camera_user = {};
camera_pass = {};
};
}; };
} }

View file

@ -8,6 +8,13 @@ let
in in
{ options.modules.system.frigate = { enable = mkEnableOption "Enable Frigate NVR"; }; { options.modules.system.frigate = { enable = mkEnableOption "Enable Frigate NVR"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
sops = {
secrets = {
camera_user = {};
camera_pass = {};
};
};
services.frigate = { services.frigate = {
enable = true; enable = true;
hostname = "frigate"; hostname = "frigate";
@ -18,46 +25,71 @@ in
}; };
cameras = { cameras = {
"Doorbell" = { "Doorbell" = {
ffpmeg.inputs = [ ffmpeg = {
inputs = [
{ {
path = "rtsp://$(cat /run/secrets/camera_user):$(cat /run/secrets/camera_pass)@192.168.0.108/cam/realmonitor?channel=1&subtype=0"; path = "rtsp://user:password@192.168.0.108/cam/realmonitor?channel=1&subtype=0";
roles = [ "detect" "record" ]; roles = [ "record" ];
}
{
path = "rtsp://user:password@192.168.0.108/cam/realmonitor?channel=1&subtype=1";
roles = [ "detect" ];
} }
]; ];
}; };
};
"Living Room" = { "Living Room" = {
ffpmeg.inputs = [ ffmpeg = {
inputs = [
{ {
path = "rtsp://admin:th3bigbl4ck@192.168.0.181/cam/realmonitor?channel=1&subtype=0"; path = "rtsp://user:password@192.168.0.181/cam/realmonitor?channel=1&subtype=0";
roles = [ "detect" "record" ]; roles = [ "record" ];
}
{
path = "rtsp://user:password@192.168.0.181/cam/realmonitor?channel=1&subtype=1";
roles = [ "detect" ];
} }
]; ];
}; };
};
"Kitchen" = { "Kitchen" = {
ffpmeg.inputs = [ ffmpeg = {
inputs = [
{ {
path = "rtsp://admin:th3bigbl4ck@192.168.0.181/cam/realmonitor?channel=2&subtype=0"; path = "rtsp://user:password@192.168.0.181/cam/realmonitor?channel=2&subtype=0";
roles = [ "detect" "record" ]; roles = [ "record" ];
}
{
path = "rtsp://user:password@192.168.0.181/cam/realmonitor?channel=2&subtype=1";
roles = [ "detect" ];
} }
]; ];
}; };
};
"Parking Lot" = { "Parking Lot" = {
ffpmeg.inputs = [ ffmpeg = {
inputs = [
{ {
path = "rtsp://admin:th3bigbl4ck@192.168.0.59/cam/realmonitor?channel=1&subtype=0"; path = "rtsp://user:password@192.168.0.59/cam/realmonitor?channel=1&subtype=0";
roles = [ "detect" "record" ]; roles = [ "record" ];
}
{
path = "rtsp://user:password@192.168.0.59/cam/realmonitor?channel=1&subtype=1";
roles = [ "detect" ];
} }
]; ];
}; };
};
"Porch" = { "Porch" = {
ffpmeg.inputs = [ ffmpeg = {
inputs = [
{ {
path = "rtsp://admin:th3bigbl4ck@192.168.0.108/cam/realmonitor?channel=1&subtype=0"; path = "rtsp://user:password@192.168.0.108/cam/realmonitor?channel=1&subtype=0";
roles = [ "detect" "record" ]; roles = [ "record" ];
}
{
path = "rtsp://user:password@192.168.0.108/cam/realmonitor?channel=1&subtype=1";
roles = [ "detect" ];
} }
]; ];
}; };
@ -65,4 +97,5 @@ in
}; };
}; };
}; };
};
} }