From be6b1fbfa44aaf2d85d197a4a009fb51b52cde7b Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sat, 23 Nov 2024 18:22:01 +0700 Subject: [PATCH] :sparkles: enable tika and gotenberg on paperless-ngx --- machines/chungus/configuration.nix | 3 +- machines/chungus/service-paperless-tika.nix | 36 +++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 machines/chungus/service-paperless-tika.nix diff --git a/machines/chungus/configuration.nix b/machines/chungus/configuration.nix index 3c968f4..4634521 100644 --- a/machines/chungus/configuration.nix +++ b/machines/chungus/configuration.nix @@ -46,9 +46,10 @@ ./service-atuin.nix ./service-forgejo.nix - ./service-paperless.nix ./service-paperless-backup.nix ./service-paperless-healthchecks.nix + ./service-paperless-tika.nix + ./service-paperless.nix ./service-s3.nix #./service-taskwarrior.nix ./service-vault.nix diff --git a/machines/chungus/service-paperless-tika.nix b/machines/chungus/service-paperless-tika.nix new file mode 100644 index 0000000..76580ce --- /dev/null +++ b/machines/chungus/service-paperless-tika.nix @@ -0,0 +1,36 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + + services.paperless = { + settings = { + PAPERLESS_TIKA_ENABLED = true; + PAPERLESS_TIKA_ENDPOINT = "http://127.0.0.1:${toString config.services.tika.port}"; + PAPERLESS_TIKA_GOTENBERG_ENDPOINT = "http://127.0.0.1:${toString config.services.gotenberg.port}"; + }; + }; + + services.tika = { + enable = true; + }; + + services.gotenberg = { + enable = true; + timeout = "300s"; + port = 3214; + }; + + systemd.services.gotenberg = { + environment.HOME = "/run/gotenberg"; + serviceConfig = { + SystemCallFilter = lib.mkAfter [ "@chown" ]; # TODO remove when fixed (https://github.com/NixOS/nixpkgs/issues/349123) + WorkingDirectory = "/run/gotenberg"; + RuntimeDirectory = "gotenberg"; + }; + }; + +}