Frigate NVR Nix-Config

I am wondering if anyone has a working Nix-Config example of frigate running on NIX.
https://search.nixos.org/packages?channel=23.05&show=frigate&from=0&size=50&sort=relevance&type=packages&query=frigate

Thanks

John

1 Like

The module optionss are here:

https://search.nixos.org/options?channel=23.05&show=services.frigate.settings&from=0&size=50&sort=relevance&type=packages&query=frigate

Here is what I tested the setup with, when I packaged frigate.

  services.frigate = {
    enable = false;
    hostname = "localhost";

    settings = {
      mqtt.enabled = false;

      #detectors.ov = {
      #  type = "openvino";
      #  device = "AUTO";
      #  model.path = "/var/lib/frigate/openvino-model/ssdlite_mobilenet_v2.xml";
      #};

      record = {
        enabled = true;
        retain = {
          days = 2;
          mode = "all";
        };
      };

      ffmpeg.hwaccel_args = "preset-vaapi";

      cameras."test1" = {
        ffmpeg.inputs = [ {
          path = "rtsp://127.0.0.1:8554/test1";
          input_args = "preset-rtsp-restream";
          roles = [ "record" ];
        } ];
      };
      cameras."test2" = {
        ffmpeg.inputs = [ {
          path = "rtsp://localaccount:localaccount@172.20.65.103:554/stream1";
          roles = [
            "record"
            "detect"
          ];
        } ];
      };
    };
  };

  # hwdec for amdgpu
  systemd.services.frigate = {
    environment.LIBVA_DRIVER_NAME = "radeonsi";
    serviceConfig = {
      SupplementaryGroups = ["render" "video"] ; # for access to dev/dri/*
      AmbientCapabilities = "CAP_PERFMON";
    };
  };

  services.go2rtc = {
    enable = false;
    settings = {
      streams = {
        "test1" = [
          "rtsp://10.83.16.12/11"
        ];
      };
      rtsp.listen = ":8554";
      webrtc.listen = ":8555";
    };
  };
2 Likes