about summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorLeona Maroni <dev@leona.is>2024-04-14 14:59:33 +0200
committerGitHub <noreply@github.com>2024-04-14 14:59:33 +0200
commit025d3a2f65e742f967c54bbdc47632be24ef2239 (patch)
tree1fdc8080efad8fc40526cccdb807c0796aef3fb1 /pkgs/applications/office
parentb23078031f33401d339f4d241ab0361f6545be0b (diff)
parentb579dac4ed3d3d059d2a701df1728bf31a05ee70 (diff)
Merge pull request #303388 from SuperSandro2000/paperless-only-enabled-languages
nixos/paperless: override enabled tesseract languages with the in paperless configured ones
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/paperless-ngx/default.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix
index 68dd3ec0f6dac..554aeb588ef7b 100644
--- a/pkgs/applications/office/paperless-ngx/default.nix
+++ b/pkgs/applications/office/paperless-ngx/default.nix
@@ -37,8 +37,11 @@ let
   # https://github.com/NixOS/nixpkgs/issues/298719
   # https://github.com/paperless-ngx/paperless-ngx/issues/5494
   python = python3.override {
-    packageOverrides = self: super: {
-      uvicorn = super.uvicorn.overridePythonAttrs (oldAttrs: {
+    packageOverrides = final: prev: {
+      # tesseract5 may be overwritten in the paperless module and we need to propagate that to make the closure reduction effective
+      ocrmypdf = prev.ocrmypdf.override { tesseract = tesseract5; };
+
+      uvicorn = prev.uvicorn.overridePythonAttrs (_: {
         version = "0.25.0";
         src = fetchFromGitHub {
           owner = "encode";
@@ -245,7 +248,7 @@ python.pkgs.buildPythonApplication rec {
   doCheck = !stdenv.isDarwin;
 
   passthru = {
-    inherit python path frontend;
+    inherit python path frontend tesseract5;
     nltkData = with nltk-data; [ punkt snowball_data stopwords ];
     tests = { inherit (nixosTests) paperless; };
   };