diff --git a/flake.lock b/flake.lock index b5924e8..f6439e6 100644 --- a/flake.lock +++ b/flake.lock @@ -516,11 +516,11 @@ "nvf": "nvf" }, "locked": { - "lastModified": 1741017710, - "narHash": "sha256-O80scxIzGHnNYe5XhWqTgIloRmrx3PsOqqdVxQ0JUKg=", + "lastModified": 1741285115, + "narHash": "sha256-Q0reKAntl3W8EP9uuAX/3QsPrO41Jvyqw3B6grov8yc=", "owner": "TheWanderingCrow", "repo": "nvix", - "rev": "001da92efdc17978cf5946cbd14d435ff813fa62", + "rev": "d2e0cc331ae40341e367b3c846c234d5d0841988", "type": "github" }, "original": { diff --git a/modules/users/overseer/services/default.nix b/modules/users/overseer/services/default.nix index e2c5613..1c01065 100644 --- a/modules/users/overseer/services/default.nix +++ b/modules/users/overseer/services/default.nix @@ -8,6 +8,5 @@ ./umami.nix ./lubelogger.nix ./openhab.nix - ./frigate.nix ]; } diff --git a/modules/users/overseer/services/frigate.nix b/modules/users/overseer/services/frigate.nix index d60f05a..f1375f7 100644 --- a/modules/users/overseer/services/frigate.nix +++ b/modules/users/overseer/services/frigate.nix @@ -2,99 +2,102 @@ lib, config, ... -}: -lib.mkIf config.user.overseer.enable { +}: { + services.go2rtc = { + enable = true; + + settings = { + streams = { + wce-0001 = [ + "ffmpeg:#input=-timeout 30000000 -i rtsp://thingino:thingino@192.168.0.173:554/ch0" + + "ffmpeg:wce-0001#audio=opus" + ]; + + wce-0001_sub = "ffmpeg:#input=-timeout 30000000 -i rtsp://thingino:thingino@192.168.0.173:554/ch1"; + + wce-0002 = [ + "ffmpeg:#input=-timeout 30000000 -i rtsp://thingino:thingino@192.168.0.26:554/ch0" + + "ffmpeg:wce-0002#audio=opus" + ]; + + wce-0002_sub = "ffmpeg:#input=-timeout 30000000 -i rtsp://thingino:thingino@192.168.0.26:554/ch1"; + }; + }; + }; + services.frigate = { enable = true; + hostname = "frigate.wanderingcrow.net"; + settings = { - go2rtc = { - streams = { - wce-0001 = [ - "ffmpeg:#input=-timeout 30000000 -i rtsp://thingino:thingino@192.168.0.173:554/ch0" - "ffmpeg:wce-0001#audio=opus" - ]; - wce-0001_sub = "ffmpeg:#input=-timeout 30000000 -i rtsp://thingino:thingino@192.168.0.173:554/ch1"; - wce-0002 = [ - "ffmpeg:#input=-timeout 30000000 -i rtsp://thingino:thingino@192.168.0.26:554/ch0" - "ffmpeg:wce-0002#audio=opus" - ]; - wce-0002_sub = "ffmpeg:#input=-timeout 30000000 -i rtsp://thingino:thingino@192.168.0.26:554/ch1"; - }; - }; cameras = { wce-0001 = { - detect.enabled = false; ffmpeg = { inputs = [ { path = "rtsp://127.0.0.1:8554/wce-0001?timeout=30"; + input_args = "preset-rtsp-restream-low-latency"; + roles = ["record"]; } + { path = "rtsp://127.0.0.1:8554/wce-0001_sub?timeout=30"; + input_args = "preset-rtsp-restream-low-latency"; + roles = ["detect" "audio"]; } ]; }; + motion = { mask = [ "0.005,0.006,0.005,0.041,0.195,0.041,0.196,0.008" + "0.904,0.007,0.903,0.042,0.994,0.042,0.994,0.006" ]; }; + live.stream_name = "wce-0001"; }; + wce-0002 = { - detect.enabled = false; ffmpeg = { inputs = [ { path = "rtsp://127.0.0.1:8554/wce-0002?timeout=30"; + input_args = "preset-rtsp-restream-low-latency"; + roles = ["record"]; } + { path = "rtsp://127.0.0.1:8554/wce-0002_sub?timeout=30"; + input_args = "preset-rtsp-restream-low-latency"; + roles = ["detect" "audio"]; } ]; }; + motion = { mask = [ "0.005,0.006,0.005,0.041,0.195,0.041,0.196,0.008" + "0.904,0.007,0.903,0.042,0.994,0.042,0.994,0.006" ]; }; + live.stream_name = "wce-0002"; }; }; }; }; - - services.nginx.virtualHosts."${config.services.frigate.hostname}" = { - forceSSL = true; - useACMEHost = "frigate.wanderingcrow.net"; - }; - services.nginx = { - enable = true; - recommendedProxySettings = true; - virtualHosts = { - "rtc.wanderingcrow.net" = { - locations."/" = { - extraConfig = '' - allow 192.168.0.0/16; - allow 10.8.0.0/24; - allow 24.179.20.202; - deny all; - ''; - proxyPass = "http://localhost:1984"; - proxyWebsockets = true; - }; - }; - }; - }; } diff --git a/modules/users/overseer/services/homepage.nix b/modules/users/overseer/services/homepage.nix index 3139d89..43920ab 100644 --- a/modules/users/overseer/services/homepage.nix +++ b/modules/users/overseer/services/homepage.nix @@ -34,7 +34,7 @@ lib.mkIf config.user.overseer.enable { allow 24.179.20.202; deny all; ''; - proxyPass = "http://localhost:8082"; + proxyPass = "http://localhost:8089"; proxyWebsockets = true; }; }; @@ -44,6 +44,7 @@ lib.mkIf config.user.overseer.enable { services = { homepage-dashboard = { enable = true; + listenPort = 8089; environmentFile = config.sops.templates."homepage-environment".path; settings = { theme = "dark";