From 816af80754cc55981ba6b6a1c154026f870b48fb Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 26 Feb 2026 16:04:49 +0100 Subject: [PATCH 1/4] frigate: 0.16.4 -> 0.17.0 https://github.com/blakeblackshear/frigate/releases/tag/v0.17.0 --- nixos/modules/services/video/frigate.nix | 28 +++++++++ pkgs/by-name/fr/frigate/ai-edge-litert.patch | 58 ++++++++++++++---- pkgs/by-name/fr/frigate/constants.patch | 22 ------- pkgs/by-name/fr/frigate/ffmpeg.patch | 8 +-- .../frigate/libteflon-driverlink-path.patch | 13 ++++ .../fr/frigate/onnxruntime-compat.patch | 31 ++++------ pkgs/by-name/fr/frigate/package.nix | 61 +++++++++++-------- .../fr/frigate/proc-cmdline-strip.patch | 11 +--- pkgs/by-name/fr/frigate/web.nix | 9 ++- 9 files changed, 146 insertions(+), 95 deletions(-) delete mode 100644 pkgs/by-name/fr/frigate/constants.patch create mode 100644 pkgs/by-name/fr/frigate/libteflon-driverlink-path.patch diff --git a/nixos/modules/services/video/frigate.nix b/nixos/modules/services/video/frigate.nix index 56c50afb0463..cd2c151e4fdd 100644 --- a/nixos/modules/services/video/frigate.nix +++ b/nixos/modules/services/video/frigate.nix @@ -348,6 +348,10 @@ in proxy_set_header X-Forwarded-Groups $http_x_forwarded_groups; proxy_set_header X-Forwarded-Email $http_x_forwarded_email; proxy_set_header X-Forwarded-Preferred-Username $http_x_forwarded_preferred_username; + proxy_set_header X-Auth-Request-User $http_x_auth_request_user; + proxy_set_header X-Auth-Request-Groups $http_x_auth_request_groups; + proxy_set_header X-Auth-Request-Email $http_x_auth_request_email; + proxy_set_header X-Auth-Request-Preferred-Username $http_x_auth_request_preferred_username; proxy_set_header X-authentik-username $http_x_authentik_username; proxy_set_header X-authentik-groups $http_x_authentik_groups; proxy_set_header X-authentik-email $http_x_authentik_email; @@ -362,6 +366,10 @@ in aio threads; vod hls; + # Use fMP4 (fragmented MP4) instead of MPEG-TS for better performance + # Smaller segments, faster generation, better browser compatibility + vod_hls_container_format fmp4; + secure_token $args; secure_token_types application/vnd.apple.mpegurl; @@ -555,6 +563,16 @@ in ${nginxProxySettings} } + location /api/auth/first_time_login { + auth_request off; + limit_except GET { + deny all; + } + rewrite ^/api(/.*)$ $1 break; + proxy_pass http://frigate-api; + ${nginxProxySettings} + } + location /api/stats { ${nginxAuthRequest} access_log off; @@ -582,6 +600,14 @@ in add_header Cache-Control "public"; ''; }; + "/fonts" = { + root = cfg.package.web; + extraConfig = '' + access_log off; + expires 1y; + add_header Cache-Control "public"; + ''; + }; "/locales/" = { root = cfg.package.web; extraConfig = '' @@ -623,6 +649,8 @@ in vod_manifest_segment_durations_mode accurate; vod_ignore_edit_list on; vod_segment_duration 10000; + + # MPEG-TS settings (not used when fMP4 is enabled, kept for reference) vod_hls_mpegts_align_frames off; vod_hls_mpegts_interleave_frames on; diff --git a/pkgs/by-name/fr/frigate/ai-edge-litert.patch b/pkgs/by-name/fr/frigate/ai-edge-litert.patch index 95a63781ccef..3a8c3f8a566f 100644 --- a/pkgs/by-name/fr/frigate/ai-edge-litert.patch +++ b/pkgs/by-name/fr/frigate/ai-edge-litert.patch @@ -1,8 +1,8 @@ diff --git a/frigate/data_processing/real_time/bird.py b/frigate/data_processing/real_time/bird.py -index d547f2dd..402876b7 100644 +index 7851c0997..520440005 100644 --- a/frigate/data_processing/real_time/bird.py +++ b/frigate/data_processing/real_time/bird.py -@@ -21,7 +21,7 @@ from .api import RealTimeProcessorApi +@@ -22,7 +22,7 @@ from .api import RealTimeProcessorApi try: from tflite_runtime.interpreter import Interpreter except ModuleNotFoundError: @@ -11,11 +11,46 @@ index d547f2dd..402876b7 100644 logger = logging.getLogger(__name__) +diff --git a/frigate/data_processing/real_time/custom_classification.py b/frigate/data_processing/real_time/custom_classification.py +index 229383d9f..2c74a6575 100644 +--- a/frigate/data_processing/real_time/custom_classification.py ++++ b/frigate/data_processing/real_time/custom_classification.py +@@ -32,7 +32,7 @@ from .api import RealTimeProcessorApi + try: + from tflite_runtime.interpreter import Interpreter + except ModuleNotFoundError: +- from tensorflow.lite.python.interpreter import Interpreter ++ from ai_edge_litert.interpreter import Interpreter + + logger = logging.getLogger(__name__) + +@@ -76,7 +76,7 @@ class CustomStateClassificationProcessor(RealTimeProcessorApi): + try: + from tflite_runtime.interpreter import Interpreter + except ModuleNotFoundError: +- from tensorflow.lite.python.interpreter import Interpreter ++ from ai_edge_litert.interpreter import Interpreter + + model_path = os.path.join(self.model_dir, "model.tflite") + labelmap_path = os.path.join(self.model_dir, "labelmap.txt") +diff --git a/frigate/detectors/detector_utils.py b/frigate/detectors/detector_utils.py +index d732de871..d8930b2ae 100644 +--- a/frigate/detectors/detector_utils.py ++++ b/frigate/detectors/detector_utils.py +@@ -6,7 +6,7 @@ import numpy as np + try: + from tflite_runtime.interpreter import Interpreter, load_delegate + except ModuleNotFoundError: +- from tensorflow.lite.python.interpreter import Interpreter, load_delegate ++ from ai_edge_litert.interpreter import Interpreter, load_delegate + + + logger = logging.getLogger(__name__) diff --git a/frigate/detectors/plugins/cpu_tfl.py b/frigate/detectors/plugins/cpu_tfl.py -index 8a54363e..68ae558b 100644 +index 00351f519..6d336bb6b 100644 --- a/frigate/detectors/plugins/cpu_tfl.py +++ b/frigate/detectors/plugins/cpu_tfl.py -@@ -10,7 +10,7 @@ from frigate.detectors.detector_config import BaseDetectorConfig +@@ -12,7 +12,7 @@ from ..detector_utils import tflite_detect_raw, tflite_init try: from tflite_runtime.interpreter import Interpreter except ModuleNotFoundError: @@ -25,23 +60,23 @@ index 8a54363e..68ae558b 100644 logger = logging.getLogger(__name__) diff --git a/frigate/detectors/plugins/edgetpu_tfl.py b/frigate/detectors/plugins/edgetpu_tfl.py -index 246d2dd4..e855bf87 100644 +index 2b94fde39..36c769b4b 100644 --- a/frigate/detectors/plugins/edgetpu_tfl.py +++ b/frigate/detectors/plugins/edgetpu_tfl.py -@@ -11,7 +11,7 @@ from frigate.detectors.detector_config import BaseDetectorConfig +@@ -13,7 +13,7 @@ from frigate.detectors.detector_config import BaseDetectorConfig, ModelTypeEnum try: from tflite_runtime.interpreter import Interpreter, load_delegate except ModuleNotFoundError: - from tensorflow.lite.python.interpreter import Interpreter, load_delegate + from ai_edge_litert.interpreter import Interpreter, load_delegate - logger = logging.getLogger(__name__) + diff --git a/frigate/embeddings/onnx/face_embedding.py b/frigate/embeddings/onnx/face_embedding.py -index eb04b43b..0c6c26fc 100644 +index 04d756897..75dfedc94 100644 --- a/frigate/embeddings/onnx/face_embedding.py +++ b/frigate/embeddings/onnx/face_embedding.py -@@ -14,7 +14,7 @@ from .runner import ONNXModelRunner +@@ -17,7 +17,7 @@ from .base_embedding import BaseEmbedding try: from tflite_runtime.interpreter import Interpreter except ModuleNotFoundError: @@ -51,10 +86,10 @@ index eb04b43b..0c6c26fc 100644 logger = logging.getLogger(__name__) diff --git a/frigate/events/audio.py b/frigate/events/audio.py -index f2a217fd..82206b5a 100644 +index e88f2ae71..ad87d19c1 100644 --- a/frigate/events/audio.py +++ b/frigate/events/audio.py -@@ -36,7 +36,7 @@ from frigate.video import start_or_restart_ffmpeg, stop_ffmpeg +@@ -43,7 +43,7 @@ from frigate.video import start_or_restart_ffmpeg, stop_ffmpeg try: from tflite_runtime.interpreter import Interpreter except ModuleNotFoundError: @@ -62,3 +97,4 @@ index f2a217fd..82206b5a 100644 + from ai_edge_litert.interpreter import Interpreter + logger = logging.getLogger(__name__) diff --git a/pkgs/by-name/fr/frigate/constants.patch b/pkgs/by-name/fr/frigate/constants.patch deleted file mode 100644 index 943e49353c01..000000000000 --- a/pkgs/by-name/fr/frigate/constants.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/frigate/comms/webpush.py b/frigate/comms/webpush.py -index c5986d45..b767e19e 100644 ---- a/frigate/comms/webpush.py -+++ b/frigate/comms/webpush.py -@@ -17,7 +17,7 @@ from titlecase import titlecase - from frigate.comms.base_communicator import Communicator - from frigate.comms.config_updater import ConfigSubscriber - from frigate.config import FrigateConfig --from frigate.const import CONFIG_DIR -+from frigate.const import BASE_DIR, CONFIG_DIR - from frigate.models import User - - logger = logging.getLogger(__name__) -@@ -333,7 +333,7 @@ class WebPushClient(Communicator): # type: ignore[misc] - - title = f"{titlecase(', '.join(sorted_objects).replace('_', ' '))}{' was' if state == 'end' else ''} detected in {titlecase(', '.join(payload['after']['data']['zones']).replace('_', ' '))}" - message = f"Detected on {titlecase(camera.replace('_', ' '))}" -- image = f"{payload['after']['thumb_path'].replace('/media/frigate', '')}" -+ image = f"{payload['after']['thumb_path'].replace(BASE_DIR, '')}" - - # if event is ongoing open to live view otherwise open to recordings view - direct_url = f"/review?id={reviewId}" if state == "end" else f"/#{camera}" diff --git a/pkgs/by-name/fr/frigate/ffmpeg.patch b/pkgs/by-name/fr/frigate/ffmpeg.patch index e5e7c44121ae..2b9d08cf2d06 100644 --- a/pkgs/by-name/fr/frigate/ffmpeg.patch +++ b/pkgs/by-name/fr/frigate/ffmpeg.patch @@ -1,5 +1,5 @@ diff --git a/frigate/config/camera/ffmpeg.py b/frigate/config/camera/ffmpeg.py -index 04bbfac7..396bcc4b 100644 +index 2c1e4cdca..d1a1f7065 100644 --- a/frigate/config/camera/ffmpeg.py +++ b/frigate/config/camera/ffmpeg.py @@ -1,4 +1,5 @@ @@ -8,7 +8,7 @@ index 04bbfac7..396bcc4b 100644 from typing import Union from pydantic import Field, field_validator -@@ -69,21 +70,11 @@ class FfmpegConfig(FrigateBaseModel): +@@ -71,21 +72,11 @@ class FfmpegConfig(FrigateBaseModel): @property def ffmpeg_path(self) -> str: @@ -33,10 +33,10 @@ index 04bbfac7..396bcc4b 100644 class CameraRoleEnum(str, Enum): diff --git a/frigate/record/export.py b/frigate/record/export.py -index 0d3f96da..463bcff4 100644 +index d4b49bb4b..bbcccff61 100644 --- a/frigate/record/export.py +++ b/frigate/record/export.py -@@ -126,7 +126,7 @@ class RecordingExporter(threading.Thread): +@@ -127,7 +127,7 @@ class RecordingExporter(threading.Thread): minutes = int(diff / 60) seconds = int(diff % 60) ffmpeg_cmd = [ diff --git a/pkgs/by-name/fr/frigate/libteflon-driverlink-path.patch b/pkgs/by-name/fr/frigate/libteflon-driverlink-path.patch new file mode 100644 index 000000000000..5adf8d0b26d5 --- /dev/null +++ b/pkgs/by-name/fr/frigate/libteflon-driverlink-path.patch @@ -0,0 +1,13 @@ +diff --git a/frigate/detectors/plugins/teflon_tfl.py b/frigate/detectors/plugins/teflon_tfl.py +index 7e29d6630..98e446d84 100644 +--- a/frigate/detectors/plugins/teflon_tfl.py ++++ b/frigate/detectors/plugins/teflon_tfl.py +@@ -26,7 +26,7 @@ class TeflonTfl(DetectionApi): + + def __init__(self, detector_config: TeflonDetectorConfig): + # Location in Debian's mesa-teflon-delegate +- delegate_library = "/usr/lib/teflon/libteflon.so" ++ delegate_library = "@driverLink@/lib/libteflon.so" + device_config = {} + + interpreter = tflite_load_delegate_interpreter( diff --git a/pkgs/by-name/fr/frigate/onnxruntime-compat.patch b/pkgs/by-name/fr/frigate/onnxruntime-compat.patch index 145c6e6722dc..fca2e6572ab1 100644 --- a/pkgs/by-name/fr/frigate/onnxruntime-compat.patch +++ b/pkgs/by-name/fr/frigate/onnxruntime-compat.patch @@ -1,19 +1,12 @@ -Disable the SimplifedLayerNormFusion optimization for onnxruntime embedding -models to prevent a crash when using FP16 models (like jinna-clip-v1) with newer -onnxruntime versions. - -https://github.com/microsoft/onnxruntime/issues/26717#issuecomment-3800462654 - - -diff --git a/frigate/embeddings/onnx/runner.py b/frigate/embeddings/onnx/runner.py -index c34c97a8d..dca91daae 100644 ---- a/frigate/embeddings/onnx/runner.py -+++ b/frigate/embeddings/onnx/runner.py -@@ -52,6 +52,7 @@ class ONNXModelRunner: - model_path, - providers=providers, - provider_options=options, -+ disabled_optimizers=["SimplifiedLayerNormFusion"], - ) - - def get_input_names(self) -> list[str]: +diff --git a/frigate/detectors/detection_runners.py b/frigate/detectors/detection_runners.py +index fcbb41e66..5b4d3f310 100644 +--- a/frigate/detectors/detection_runners.py ++++ b/frigate/detectors/detection_runners.py +@@ -603,6 +603,7 @@ def get_optimized_runner( + ), + providers=providers, + provider_options=options, ++ disabled_optimizers=["SimplifiedLayerNormFusion"], + ), + model_type=model_type, + ) diff --git a/pkgs/by-name/fr/frigate/package.nix b/pkgs/by-name/fr/frigate/package.nix index ca26f3f83c8b..48eab52aea68 100644 --- a/pkgs/by-name/fr/frigate/package.nix +++ b/pkgs/by-name/fr/frigate/package.nix @@ -1,6 +1,8 @@ { lib, stdenv, + replaceVars, + addDriverRunpath, callPackage, python313Packages, fetchFromGitHub, @@ -9,18 +11,17 @@ sqlite-vec, frigate, nixosTests, - fetchpatch, }: let - version = "0.16.4"; + version = "0.17.0"; src = fetchFromGitHub { name = "frigate-${version}-source"; owner = "blakeblackshear"; repo = "frigate"; tag = "v${version}"; - hash = "sha256-TPiCT/z0YuoQkQsxyZsRMQa0XwqMLCgwMbrASOKrMjA="; + hash = "sha256-K41tWnj0u+Fw+G++aPFfMa0uFYEvvZ0r6xNPQ7J1cYs="; }; frigate-web = callPackage ./web.nix { @@ -77,27 +78,23 @@ python3Packages.buildPythonApplication rec { inherit src; patches = [ - ./constants.patch - # Fixes hardcoded path /media/frigate/clips/faces. Remove in next version. - (fetchpatch { - url = "https://github.com/blakeblackshear/frigate/commit/b86e6e484f64bd43b64d7adebe78671a7a426edb.patch"; - hash = "sha256-1+n0n0yCtjfAHkXzsZdIF0iCVdPGmsG7l8/VTqBVEjU="; - }) + # Always lookup ffmpeg from config setting ./ffmpeg.patch + + # Adjust libteflon.so location + (replaceVars ./libteflon-driverlink-path.patch { + inherit (addDriverRunpath) driverLink; + }) + + # Use ai-edge-litert as tensorflow interpreter # https://github.com/blakeblackshear/frigate/pull/21876 ./ai-edge-litert.patch - (fetchpatch { - # peewee-migrate 0.14.x compat - url = "https://github.com/blakeblackshear/frigate/commit/dde02cadb2168c44e9eb395ddfbb7b169096bd15.patch"; - excludes = [ - "docker/main/requirements-wheels.txt" - "migrations/031_create_trigger_table.py" - "migrations/032_add_password_changed_at.py" - ]; - hash = "sha256-RrmwjE4SHJIUOYfqcCtMy9Pht7UXhHcoAZlFQv9aQFw="; - }) + + # Disable failing optimization in onnxruntime # https://github.com/microsoft/onnxruntime/issues/26717 ./onnxruntime-compat.patch + + # Fix excessive trailing whitespaces in process commandlines # https://github.com/blakeblackshear/frigate/pull/22089 ./proc-cmdline-strip.patch ]; @@ -107,7 +104,7 @@ python3Packages.buildPythonApplication rec { substituteInPlace \ frigate/app.py \ - frigate/test/test_{http,storage}.py \ + frigate/test/test_storage.py \ frigate/test/http_api/base_http_test.py \ --replace-fail "Router(migrate_db)" 'Router(migrate_db, "${placeholder "out"}/share/frigate/migrations")' @@ -118,7 +115,13 @@ python3Packages.buildPythonApplication rec { --replace-fail "/config" "/var/lib/frigate" \ --replace-fail "{CONFIG_DIR}/model_cache" "/var/cache/frigate/model_cache" - substituteInPlace frigate/comms/{config,embeddings}_updater.py frigate/comms/{zmq_proxy,inter_process}.py \ + substituteInPlace \ + frigate/comms/config_updater.py \ + frigate/comms/embeddings_updater.py \ + frigate/comms/inter_process.py \ + frigate/comms/object_detector_signaler.py \ + frigate/comms/zmq_proxy.py \ + frigate/detectors/plugins/zmq_ipc.py \ --replace-fail "ipc:///tmp/cache" "ipc:///run/frigate" substituteInPlace frigate/db/sqlitevecq.py \ @@ -140,25 +143,27 @@ python3Packages.buildPythonApplication rec { dontBuild = true; dependencies = with python3Packages; [ - # docker/main/requirements.txt - scikit-build # docker/main/requirements-wheel.txt + # TODO: degirum (no source repo, binary wheels only) ai-edge-litert aiofiles aiohttp appdirs argcomplete - contextlib2 click + contextlib2 + cryptography distlib fastapi + faster-whisper filelock + google-genai importlib-metadata importlib-resources - google-generativeai joserfc - levenshtein + librosa markupsafe + memray netaddr netifaces norfair @@ -184,14 +189,18 @@ python3Packages.buildPythonApplication rec { py-vapid pywebpush pyzmq + rapidfuzz requests ruamel-yaml scipy setproctitle shapely + sherpa-onnx slowapi + soundfile starlette starlette-context + tensorflow titlecase transformers tzlocal diff --git a/pkgs/by-name/fr/frigate/proc-cmdline-strip.patch b/pkgs/by-name/fr/frigate/proc-cmdline-strip.patch index 426dd20ae266..2dd131ebf419 100644 --- a/pkgs/by-name/fr/frigate/proc-cmdline-strip.patch +++ b/pkgs/by-name/fr/frigate/proc-cmdline-strip.patch @@ -1,13 +1,8 @@ -Strip trailing whitespace from process commandlines. This is annoying for exact -process matches against Prometheus labels. - -https://github.com/blakeblackshear/frigate/pull/22089 - diff --git a/frigate/util/services.py b/frigate/util/services.py -index b31a7eea3..f1e8f0f5f 100644 +index 64d83833d..912ce67bd 100644 --- a/frigate/util/services.py +++ b/frigate/util/services.py -@@ -118,7 +118,7 @@ def get_cpu_stats() -> dict[str, dict]: +@@ -121,7 +121,7 @@ def get_cpu_stats() -> dict[str, dict]: pid = str(process.info["pid"]) try: cpu_percent = process.info["cpu_percent"] @@ -16,7 +11,7 @@ index b31a7eea3..f1e8f0f5f 100644 with open(f"/proc/{pid}/stat", "r") as f: stats = f.readline().split() -@@ -152,7 +152,7 @@ def get_cpu_stats() -> dict[str, dict]: +@@ -155,7 +155,7 @@ def get_cpu_stats() -> dict[str, dict]: "cpu": str(cpu_percent), "cpu_average": str(round(cpu_average_usage, 2)), "mem": f"{mem_pct}", diff --git a/pkgs/by-name/fr/frigate/web.nix b/pkgs/by-name/fr/frigate/web.nix index b6f6e48b4260..7e284818b975 100644 --- a/pkgs/by-name/fr/frigate/web.nix +++ b/pkgs/by-name/fr/frigate/web.nix @@ -18,21 +18,20 @@ buildNpmPackage { --replace-fail '/BASE_PATH/' '/' substituteInPlace \ - src/pages/Exports.tsx \ - src/components/preview/ScrubbablePreview.tsx \ + src/components/card/AnimatedEventCard.tsx \ src/components/card/ExportCard.tsx \ src/components/card/ReviewCard.tsx \ - src/components/card/AnimatedEventCard.tsx \ src/components/player/PreviewThumbnailPlayer.tsx \ + src/components/preview/ScrubbablePreview.tsx \ + src/pages/Exports.tsx \ src/views/system/StorageMetrics.tsx \ - src/components/timeline/EventSegment.tsx \ --replace-fail "/media/frigate" "/var/lib/frigate" \ substituteInPlace src/views/system/StorageMetrics.tsx \ --replace-fail "/tmp/cache" "/var/cache/frigate" ''; - npmDepsHash = "sha256-CrK/6BaKmKIxlohEZdGEEKJkioszBUupyKQx4nBeLqI="; + npmDepsHash = "sha256-iIqP3pspkDbaXZkZ5MIT/GVGiKBJCkFXQ7Av5h1rWKk="; installPhase = '' cp -rv dist/ $out From fe689974f042923beedd73e11f1d4eb10ecad055 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 28 Feb 2026 00:40:24 +0100 Subject: [PATCH 2/4] python3Packages.huggingface: reintroduce at 0.36.2 --- .../python-modules/huggingface-hub/0.nix | 124 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 126 insertions(+) create mode 100644 pkgs/development/python-modules/huggingface-hub/0.nix diff --git a/pkgs/development/python-modules/huggingface-hub/0.nix b/pkgs/development/python-modules/huggingface-hub/0.nix new file mode 100644 index 000000000000..1ca7b24da37f --- /dev/null +++ b/pkgs/development/python-modules/huggingface-hub/0.nix @@ -0,0 +1,124 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + filelock, + fsspec, + hf-xet, + packaging, + pyyaml, + requests, + tqdm, + typing-extensions, + + # optional-dependencies + # cli + inquirerpy, + # inference + aiohttp, + # torch + torch, + safetensors, + # hf_transfer + hf-transfer, + # fastai + toml, + fastai, + fastcore, + # tensorflow + tensorflow, + pydot, + graphviz, + # tensorflow-testing + keras, + + # tests + versionCheckHook, +}: + +buildPythonPackage rec { + pname = "huggingface-hub"; + version = "0.36.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "huggingface"; + repo = "huggingface_hub"; + tag = "v${version}"; + hash = "sha256-cUp5Mm8vgJI/0N/9inQVedGWRde8lioduFoccq6b7UE="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + filelock + fsspec + hf-xet + packaging + pyyaml + requests + tqdm + typing-extensions + ]; + + optional-dependencies = { + all = [ + + ]; + cli = [ + inquirerpy + ]; + inference = [ + aiohttp + ]; + torch = [ + torch + safetensors + ] + ++ safetensors.optional-dependencies.torch; + hf_transfer = [ + hf-transfer + ]; + fastai = [ + toml + fastai + fastcore + ]; + tensorflow = [ + tensorflow + pydot + graphviz + ]; + tensorflow-testing = [ + tensorflow + keras + ]; + hf_xet = [ + hf-xet + ]; + }; + + nativeCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = "version"; + + pythonImportsCheck = [ "huggingface_hub" ]; + + meta = { + description = "Download and publish models and other files on the huggingface.co hub"; + mainProgram = "hf"; + homepage = "https://github.com/huggingface/huggingface_hub"; + changelog = "https://github.com/huggingface/huggingface_hub/releases/tag/v${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ + GaetanLepage + osbm + ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e707fbef7e0e..72a6c4eb265d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7184,6 +7184,8 @@ self: super: with self; { huggingface-hub = callPackage ../development/python-modules/huggingface-hub { }; + huggingface-hub_0 = callPackage ../development/python-modules/huggingface-hub/0.nix { }; + human-readable = callPackage ../development/python-modules/human-readable { }; humanfriendly = callPackage ../development/python-modules/humanfriendly { }; From 23bfb601c00bab046ee5a483267ad4b7ce1fcfac Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 28 Feb 2026 00:43:58 +0100 Subject: [PATCH 3/4] python3Packages.transformers_4: reintroduce at 4.57.6 --- .../python-modules/transformers/4.nix | 208 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 210 insertions(+) create mode 100644 pkgs/development/python-modules/transformers/4.nix diff --git a/pkgs/development/python-modules/transformers/4.nix b/pkgs/development/python-modules/transformers/4.nix new file mode 100644 index 000000000000..273c3d60fb75 --- /dev/null +++ b/pkgs/development/python-modules/transformers/4.nix @@ -0,0 +1,208 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + filelock, + huggingface-hub, + numpy, + protobuf, + packaging, + pyyaml, + regex, + requests, + tokenizers, + safetensors, + tqdm, + + # optional-dependencies + diffusers, + scikit-learn, + tensorflow, + onnxconverter-common, + opencv4, + tf2onnx, + torch, + accelerate, + faiss, + datasets, + jax, + jaxlib, + flax, + optax, + ftfy, + onnxruntime, + onnxruntime-tools, + cookiecutter, + sagemaker, + fairscale, + optuna, + ray, + pydantic, + uvicorn, + fastapi, + starlette, + librosa, + phonemizer, + torchaudio, + pillow, + timm, + torchvision, + av, + sentencepiece, + hf-xet, +}: + +buildPythonPackage (finalAttrs: { + pname = "transformers"; + version = "4.57.6"; + pyproject = true; + + src = fetchFromGitHub { + owner = "huggingface"; + repo = "transformers"; + tag = "v${finalAttrs.version}"; + hash = "sha256-a78ornUAYlOpr30iFdq1oUiWQTm6GeT0iq8ras5i3DQ="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + filelock + huggingface-hub + numpy + packaging + pyyaml + regex + requests + tokenizers + safetensors + tqdm + ]; + + pythonRelaxDeps = [ "huggingface-hub" ]; + + optional-dependencies = + let + audio = [ + librosa + # pyctcdecode + phonemizer + # kenlm + ]; + vision = [ pillow ]; + in + { + agents = [ + diffusers + accelerate + datasets + torch + sentencepiece + opencv4 + pillow + ]; + ja = [ + # fugashi + # ipadic + # rhoknp + # sudachidict_core + # sudachipy + # unidic + # unidic_lite + ]; + sklearn = [ scikit-learn ]; + tf = [ + tensorflow + onnxconverter-common + tf2onnx + # tensorflow-text + # keras-nlp + ]; + torch = [ + torch + accelerate + ]; + retrieval = [ + faiss + datasets + ]; + flax = [ + jax + jaxlib + flax + optax + ]; + hf_xet = [ + hf-xet + ]; + tokenizers = [ tokenizers ]; + ftfy = [ ftfy ]; + onnxruntime = [ + onnxruntime + onnxruntime-tools + ]; + onnx = [ + onnxconverter-common + tf2onnx + onnxruntime + onnxruntime-tools + ]; + modelcreation = [ cookiecutter ]; + sagemaker = [ sagemaker ]; + deepspeed = [ + # deepspeed + accelerate + ]; + fairscale = [ fairscale ]; + optuna = [ optuna ]; + ray = [ ray ] ++ ray.optional-dependencies.tune; + # sigopt = [ sigopt ]; + # integrations = ray ++ optuna ++ sigopt; + serving = [ + pydantic + uvicorn + fastapi + starlette + ]; + audio = audio; + speech = [ torchaudio ] ++ audio; + torch-speech = [ torchaudio ] ++ audio; + tf-speech = audio; + flax-speech = audio; + timm = [ timm ]; + torch-vision = [ torchvision ] ++ vision; + # natten = [ natten ]; + # codecarbon = [ codecarbon ]; + video = [ + av + ]; + sentencepiece = [ + sentencepiece + protobuf + ]; + }; + + # Many tests require internet access. + doCheck = false; + + pythonImportsCheck = [ "transformers" ]; + + meta = { + broken = lib.versionAtLeast huggingface-hub.version "1.0"; + homepage = "https://github.com/huggingface/transformers"; + description = "Natural Language Processing for TensorFlow 2.0 and PyTorch"; + mainProgram = "transformers-cli"; + changelog = "https://github.com/huggingface/transformers/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.asl20; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ + pashashocky + happysalada + ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 72a6c4eb265d..15d499c9bd01 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19397,6 +19397,8 @@ self: super: with self; { transformers = callPackage ../development/python-modules/transformers { }; + transformers_4 = callPackage ../development/python-modules/transformers/4.nix { }; + transforms3d = callPackage ../development/python-modules/transforms3d { }; transitions = callPackage ../development/python-modules/transitions { }; From 4c9be371f2a82af24471803518a61be5ca0b671a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 28 Feb 2026 00:50:01 +0100 Subject: [PATCH 4/4] frigate: pin transformers 4.x to support older hugginggface models The huggingface-hub pin is required for transformers 4.x support. --- pkgs/by-name/fr/frigate/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/fr/frigate/package.nix b/pkgs/by-name/fr/frigate/package.nix index 48eab52aea68..7dc8a3620169 100644 --- a/pkgs/by-name/fr/frigate/package.nix +++ b/pkgs/by-name/fr/frigate/package.nix @@ -39,6 +39,9 @@ let hash = "sha256-95xtUzzIxxvDtpHX/5uCHnTQTB8Fc08DZGUOR/SdKLs="; }; }); + + huggingface-hub = super.huggingface-hub_0; + transformers = super.transformers_4; }; }; python3Packages = python.pkgs;