Loading pkgs/development/python-modules/libretranslate/default.nix +24 −0 Original line number Diff line number Diff line { lib, pkgs, buildPythonPackage, fetchFromGitHub, pytestCheckHook, runCommand, hatchling, argostranslate, flask, Loading @@ -15,6 +17,7 @@ expiringdict, langdetect, lexilang, libretranslate, ltpycld2, morfessor, appdirs, Loading @@ -26,6 +29,7 @@ prometheus-client, polib, python, xorg, }: buildPythonPackage rec { Loading Loading @@ -85,6 +89,26 @@ buildPythonPackage rec { pythonImportsCheck = [ "libretranslate" ]; passthru = { static-compressed = runCommand "libretranslate-data-compressed" { nativeBuildInputs = [ pkgs.brotli xorg.lndir ]; } '' mkdir -p $out/share/libretranslate/static lndir ${libretranslate}/share/libretranslate/static $out/share/libretranslate/static # Create static gzip and brotli files find -L $out -type f -regextype posix-extended -iregex '.*\.(css|ico|js|svg|ttf)' \ -exec gzip --best --keep --force {} ';' \ -exec brotli --best --keep --no-copy-stat {} ';' ''; }; meta = with lib; { description = "Free and Open Source Machine Translation API. Self-hosted, no limits, no ties to proprietary services"; homepage = "https://libretranslate.com"; Loading Loading
pkgs/development/python-modules/libretranslate/default.nix +24 −0 Original line number Diff line number Diff line { lib, pkgs, buildPythonPackage, fetchFromGitHub, pytestCheckHook, runCommand, hatchling, argostranslate, flask, Loading @@ -15,6 +17,7 @@ expiringdict, langdetect, lexilang, libretranslate, ltpycld2, morfessor, appdirs, Loading @@ -26,6 +29,7 @@ prometheus-client, polib, python, xorg, }: buildPythonPackage rec { Loading Loading @@ -85,6 +89,26 @@ buildPythonPackage rec { pythonImportsCheck = [ "libretranslate" ]; passthru = { static-compressed = runCommand "libretranslate-data-compressed" { nativeBuildInputs = [ pkgs.brotli xorg.lndir ]; } '' mkdir -p $out/share/libretranslate/static lndir ${libretranslate}/share/libretranslate/static $out/share/libretranslate/static # Create static gzip and brotli files find -L $out -type f -regextype posix-extended -iregex '.*\.(css|ico|js|svg|ttf)' \ -exec gzip --best --keep --force {} ';' \ -exec brotli --best --keep --no-copy-stat {} ';' ''; }; meta = with lib; { description = "Free and Open Source Machine Translation API. Self-hosted, no limits, no ties to proprietary services"; homepage = "https://libretranslate.com"; Loading