nix-conf/system/modules/paperless-ngx.nix
danny dfda745829 feat: nextcloud whiteboard server
features:
nextcloud whiteboard server
nextcloud memories with recognize patch
2025-10-15 23:10:28 +08:00

36 lines
882 B
Nix

{
domain ? "localhost",
configureNginx ? true,
passwordFile,
}:
{ config, lib, ... }:
let
inherit (lib) mkIf optionalString;
in
{
services.paperless = {
enable = true;
passwordFile = passwordFile;
consumptionDirIsPublic = true;
settings = {
PAPERLESS_CONSUMER_IGNORE_PATTERN = [
".DS_STORE/*"
"desktop.ini"
];
PAPERLESS_OCR_LANGUAGE = "chi_tra+eng";
PAPERLESS_OCR_USER_ARGS = {
optimize = 1;
pdfa_image_compression = "lossless";
};
PAPERLESS_URL = "http${optionalString configureNginx "s"}://${domain}";
};
configureTika = true;
database.createLocally = true;
};
services.nginx.virtualHosts."${domain}" = mkIf configureNginx {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:${toString config.services.paperless.port}";
};
}