mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-12 08:43:06 +00:00
250078ceba
Changelog: https://github.com/blakeblackshear/frigate/releases/tag/v0.13.0 https://github.com/blakeblackshear/frigate/releases/tag/v0.13.1 Co-Authored-By: Martin Weinelt <hexa@darmstadt.ccc.de>
66 lines
1.5 KiB
Nix
66 lines
1.5 KiB
Nix
import ./make-test-python.nix ({ pkgs, lib, ...} :
|
|
|
|
{
|
|
name = "frigate";
|
|
meta.maintainers = with lib.maintainers; [ hexa ];
|
|
|
|
nodes = {
|
|
machine = { config, ... }: {
|
|
services.frigate = {
|
|
enable = true;
|
|
|
|
hostname = "localhost";
|
|
|
|
settings = {
|
|
mqtt.enabled = false;
|
|
|
|
cameras.test = {
|
|
ffmpeg = {
|
|
input_args = "-fflags nobuffer -strict experimental -fflags +genpts+discardcorrupt -r 10 -use_wallclock_as_timestamps 1";
|
|
inputs = [ {
|
|
path = "http://127.0.0.1:8080";
|
|
roles = [
|
|
"record"
|
|
];
|
|
} ];
|
|
};
|
|
};
|
|
|
|
record.enabled = true;
|
|
};
|
|
};
|
|
|
|
systemd.services.video-stream = {
|
|
description = "Start a test stream that frigate can capture";
|
|
before = [
|
|
"frigate.service"
|
|
];
|
|
wantedBy = [
|
|
"multi-user.target"
|
|
];
|
|
serviceConfig = {
|
|
DynamicUser = true;
|
|
ExecStart = "${lib.getBin pkgs.ffmpeg-headless}/bin/ffmpeg -re -f lavfi -i smptebars=size=800x600:rate=10 -f mpegts -listen 1 http://0.0.0.0:8080";
|
|
Restart = "always";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
start_all()
|
|
|
|
machine.wait_for_unit("frigate.service")
|
|
|
|
# Frigate startup
|
|
machine.wait_for_open_port(5001)
|
|
|
|
# nginx startup
|
|
machine.wait_for_open_port(80)
|
|
|
|
machine.succeed("curl http://localhost")
|
|
|
|
machine.wait_for_file("/var/cache/frigate/test@*.mp4")
|
|
'';
|
|
})
|