nixos-config/nixos/machines/chungus/paperless.nix
Ingolf Wagner 5fbe52eb11
make loki, promtail better
(better indices and so on)
2024-05-15 22:54:12 +02:00

38 lines
1.1 KiB
Nix

{ config, pkgs, nixos-artwork, ... }: {
services.paperless = {
enable = true;
address = "0.0.0.0";
package = pkgs.unstable.paperless;
extraConfig = {
PAPERLESS_OCR_LANGUAGE = "deu+eng";
PAPERLESS_APP_TITLE = "paperless.chungus.private";
PAPERLESS_CONSUMER_IGNORE_PATTERN = builtins.toJSON [ ".DS_STORE/*" "desktop.ini" ];
PAPERLESS_EMAIL_TASK_CRON = "0 */8 * * *"; # “At minute 0 past every 8th hour.”
#PAPERLESS_CONSUMER_DELETE_DUPLICATES = true;
};
};
services.permown."/var/lib/paperless/consume" = {
owner = "paperless";
group = "paperless";
directory-mode = "755";
file-mode = "640";
};
networking.firewall.interfaces.wg0.allowedTCPPorts = [ config.services.paperless.port ];
services.nginx.virtualHosts."paperless.${config.networking.hostName}.private" = {
extraConfig = ''
allow ${config.tinc.private.subnet};
deny all;
'';
locations."/" = {
extraConfig = ''
client_max_body_size 500M;
'';
proxyPass = "http://localhost:${toString config.services.paperless.port}";
proxyWebsockets = true;
};
};
}