nixos/frigate: set LIBAVFORMAT_VERSION_MAJOR (#492023)

This commit is contained in:
Martin Weinelt
2026-02-25 18:02:05 +00:00
committed by GitHub
+9
View File
@@ -699,6 +699,15 @@ in
environment = {
CONFIG_FILE = "/run/frigate/frigate.yml";
HOME = "/var/lib/frigate";
# Extract libavformat version in the same way Docker scripts in frigate directory do. This
# environment variable changes the flags given to `ffmpeg` improving compatibility.
LIBAVFORMAT_VERSION_MAJOR = lib.strings.trim (
builtins.readFile (
pkgs.runCommandLocal "libavformat-major-version" { } ''
${cfg.settings.ffmpeg.path}/bin/ffmpeg -version | grep -Po "libavformat\W+\K\d+" > $out
''
)
);
PYTHONPATH = cfg.package.pythonPath;
}
// optionalAttrs (cfg.vaapiDriver != null) {