From 9de82e992cd9b5b09941f8e46c75adc3b024e3b8 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Wed, 30 Apr 2025 17:52:12 +0100 Subject: [PATCH] frigate: fix platform-based condition The current condition `stdenv.hostPlatform == "x86_64-linux"` will never be true, because `stdenv.hostPlatform` is not a string. The intent is to use `rocmPackages.clr` only where clang-rocm can run, which is only on x86_64-linux. We can't use `lib.meta.availableOn` for `rocmPackages.clr` because it only checks `meta.platform` for the package, but not for its transitive dependencies that are unavailable. --- pkgs/by-name/fr/frigate/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/fr/frigate/package.nix b/pkgs/by-name/fr/frigate/package.nix index eaf2fe1b630a..8e7178f285b0 100644 --- a/pkgs/by-name/fr/frigate/package.nix +++ b/pkgs/by-name/fr/frigate/package.nix @@ -88,7 +88,8 @@ python.pkgs.buildPythonApplication rec { --replace-fail "/usr/local/lib/vec0" "${lib.getLib sqlite-vec}/lib/vec0${stdenv.hostPlatform.extensions.sharedLibrary}" '' - + lib.optionalString (stdenv.hostPlatform == "x86_64-linux") '' + # clang-rocm, provided by `rocmPackages.clr`, only works on x86_64-linux specifically + + lib.optionalString (with stdenv.hostPlatform; isx86_64 && isLinux) '' substituteInPlace frigate/detectors/plugins/rocm.py \ --replace-fail "/opt/rocm/bin/rocminfo" "rocminfo" \ --replace-fail "/opt/rocm/lib" "${rocmPackages.clr}/lib"