62 lines
No EOL
1.4 KiB
Nix
62 lines
No EOL
1.4 KiB
Nix
{ inputs, ... }:
|
|
{
|
|
flake.modules.nixos.frigate =
|
|
{ lib, config, ... }:
|
|
{
|
|
|
|
imports = with inputs.self.modules.nixos; [
|
|
podman
|
|
];
|
|
|
|
age.secrets.frigate.file = ../../../secrets/frigate.age;
|
|
|
|
virtualisation.oci-containers.containers."frigate" = {
|
|
image = "ghcr.io/blakeblackshear/frigate:stable";
|
|
privileged = true;
|
|
volumes = [
|
|
"/etc/localtime:/etc/localtime:ro"
|
|
"/DockerData/configs/frigate/config:/config"
|
|
"/DockerData/configs/frigate/storage:/media/frigate"
|
|
];
|
|
labels = {
|
|
"io.containers.autoupdate" = "registry";
|
|
};
|
|
ports = [
|
|
"8971:8971"
|
|
"8554:8554"
|
|
"8555:8555/tcp"
|
|
"8555:8555/udp"
|
|
];
|
|
devices = [
|
|
"/dev/bus/usb:/dev/bus/usb"
|
|
"/dev/dri:/dev/dri"
|
|
];
|
|
environmentFiles = [
|
|
"${config.age.secrets.frigate.path}"
|
|
];
|
|
log-driver = "journald";
|
|
extraOptions = [
|
|
"--shm-size=800m"
|
|
];
|
|
};
|
|
|
|
systemd = {
|
|
services = {
|
|
"podman-frigate" = {
|
|
serviceConfig = {
|
|
Restart = lib.mkOverride 90 "always";
|
|
};
|
|
partOf = [ "podman-compose-frigate-root.target" ];
|
|
wantedBy = [ "podman-compose-frigate-root.target" ];
|
|
};
|
|
};
|
|
|
|
targets = {
|
|
"podman-compose-frigate-root" = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
};
|
|
};
|
|
};
|
|
|
|
};
|
|
} |