From f1de6cf3ee4c68ea62d04ae5988b98bf7d74180d Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Wed, 16 Jul 2025 09:07:48 -0400 Subject: [PATCH] temp --- src/system/machines/server/system.nix | 5 +- src/system/modules/frigate/default.nix | 101 ++++++++++++++++--------- 2 files changed, 68 insertions(+), 38 deletions(-) diff --git a/src/system/machines/server/system.nix b/src/system/machines/server/system.nix index a2b77b9..36a3b5d 100644 --- a/src/system/machines/server/system.nix +++ b/src/system/machines/server/system.nix @@ -8,6 +8,7 @@ system = { nginx.enable = true; forgejo.enable = true; + frigate.enable = true; bitcoin = { enable = true; electrum.enable = true; @@ -124,9 +125,5 @@ keyFile = "/var/lib/sops-nix/key.txt"; generateKey = true; }; - secrets = { - camera_user = {}; - camera_pass = {}; - }; }; } diff --git a/src/system/modules/frigate/default.nix b/src/system/modules/frigate/default.nix index 8905aca..8909d2e 100644 --- a/src/system/modules/frigate/default.nix +++ b/src/system/modules/frigate/default.nix @@ -8,6 +8,13 @@ let in { options.modules.system.frigate = { enable = mkEnableOption "Enable Frigate NVR"; }; config = mkIf cfg.enable { + sops = { + secrets = { + camera_user = {}; + camera_pass = {}; + }; + }; + services.frigate = { enable = true; hostname = "frigate"; @@ -18,48 +25,74 @@ in }; cameras = { "Doorbell" = { - ffpmeg.inputs = [ - { - path = "rtsp://$(cat /run/secrets/camera_user):$(cat /run/secrets/camera_pass)@192.168.0.108/cam/realmonitor?channel=1&subtype=0"; - roles = [ "detect" "record" ]; - } - ]; + ffmpeg = { + inputs = [ + { + path = "rtsp://user:password@192.168.0.108/cam/realmonitor?channel=1&subtype=0"; + roles = [ "record" ]; + } + { + path = "rtsp://user:password@192.168.0.108/cam/realmonitor?channel=1&subtype=1"; + roles = [ "detect" ]; + } + ]; + }; }; - "Living Room" = { - ffpmeg.inputs = [ - { - path = "rtsp://admin:th3bigbl4ck@192.168.0.181/cam/realmonitor?channel=1&subtype=0"; - roles = [ "detect" "record" ]; - } - ]; + ffmpeg = { + inputs = [ + { + path = "rtsp://user:password@192.168.0.181/cam/realmonitor?channel=1&subtype=0"; + roles = [ "record" ]; + } + { + path = "rtsp://user:password@192.168.0.181/cam/realmonitor?channel=1&subtype=1"; + roles = [ "detect" ]; + } + ]; + }; }; - "Kitchen" = { - ffpmeg.inputs = [ - { - path = "rtsp://admin:th3bigbl4ck@192.168.0.181/cam/realmonitor?channel=2&subtype=0"; - roles = [ "detect" "record" ]; - } - ]; + ffmpeg = { + inputs = [ + { + path = "rtsp://user:password@192.168.0.181/cam/realmonitor?channel=2&subtype=0"; + roles = [ "record" ]; + } + { + path = "rtsp://user:password@192.168.0.181/cam/realmonitor?channel=2&subtype=1"; + roles = [ "detect" ]; + } + ]; + }; }; - "Parking Lot" = { - ffpmeg.inputs = [ - { - path = "rtsp://admin:th3bigbl4ck@192.168.0.59/cam/realmonitor?channel=1&subtype=0"; - roles = [ "detect" "record" ]; - } - ]; + ffmpeg = { + inputs = [ + { + path = "rtsp://user:password@192.168.0.59/cam/realmonitor?channel=1&subtype=0"; + roles = [ "record" ]; + } + { + path = "rtsp://user:password@192.168.0.59/cam/realmonitor?channel=1&subtype=1"; + roles = [ "detect" ]; + } + ]; + }; }; - "Porch" = { - ffpmeg.inputs = [ - { - path = "rtsp://admin:th3bigbl4ck@192.168.0.108/cam/realmonitor?channel=1&subtype=0"; - roles = [ "detect" "record" ]; - } - ]; + ffmpeg = { + inputs = [ + { + path = "rtsp://user:password@192.168.0.108/cam/realmonitor?channel=1&subtype=0"; + roles = [ "record" ]; + } + { + path = "rtsp://user:password@192.168.0.108/cam/realmonitor?channel=1&subtype=1"; + roles = [ "detect" ]; + } + ]; + }; }; }; };