Skip to content

Commit

Permalink
tika: add enableOcr option
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jul 17, 2024
1 parent 2d00d12 commit 8e8e24f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions nix/services/tika.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ in
type = types.port;
};

enableOcr = lib.mkOption {
default = true;
description = ''
Whether to enable OCR support by adding the `tesseract` package as a dependency.
'';
type = types.bool;
};

configFile = lib.mkOption {
type = types.nullOr types.path;
default = null;
Expand All @@ -33,8 +41,12 @@ in
outputs = {
settings = {
processes = {
"${name}" = {
command = "${lib.getExe config.package} --host ${config.host} --port ${toString config.port} ${lib.optionalString (config.configFile != null) "--config ${config.configFile}"}";
"${name}" = let
tikaPackage = config.package.override {
enableOcr = config.enableOcr;
};
in {
command = "${lib.getExe tikaPackage} --host ${config.host} --port ${toString config.port} ${lib.optionalString (config.configFile != null) "--config ${config.configFile}"}";
availability.restart = "on_failure";
readiness_probe = {
http_get = {
Expand Down

0 comments on commit 8e8e24f

Please sign in to comment.