feat(eientei): add frigate

This commit is contained in:
514fpv 2024-02-02 07:33:17 +08:00
parent 28b68562fc
commit 8e935ab6aa
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw
2 changed files with 43 additions and 0 deletions

30
spec/eientei/frigate.nix Normal file
View file

@ -0,0 +1,30 @@
{ pkgs
, config
, ...}: {
# container image used for edgetpu support
virtualisation.oci-containers.containers.frigate = {
extraOptions = [
"--privileged"
"--shm-size=128mb"
"--device=/dev/bus/usb:/dev/bus/usb"
];
image = "ghcr.io/blakeblackshear/frigate:stable";
volumes = [
"/etc/localtime:/etc/localtime:ro"
"/nix/persist/service/frigate/config:/config"
"/nix/persist/service/frigate/data:/media/frigate"
#"/tmp/frigate:/tmp/cache"
];
ports = [
"5000:5000"
"8554:8554" # RTSP feeds
"8555:8555/tcp" # WebRTC over tcp
"8555:8555/udp" # WebRTC over udp
];
};
networking.firewall.interfaces.enp0s20f0u1.allowedTCPPorts = [ 5000 8554 8555 ];
networking.firewall.interfaces.enp0s20f0u1.allowedUDPPorts = [ 8555 ];
global.fs.zfs.mountpoints."/nix/persist/service/frigate" = "service/frigate";
}

View file

@ -0,0 +1,13 @@
{
services.mosquitto = {
enable = true;
listeners = [ {
users.frigate = {
acl = [ "readwrite #" ];
hashedPassword = "$7$101$Zt3Me3AkHbrKBbbI$SsLTGeTwtkFGXS2F1/S3Vg6w7TcgMLU037ttedKaw/Ela0wgqbaAVxecK1j5i5TDw9OjZMkNI9mUzz9l0d7vcg==";
};
} ];
};
networking.firewall.allowedTCPPorts = [ 1883 ];
}