2024-08-29 03:26:04 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
2024-09-15 04:11:25 +02:00
|
|
|
lib,
|
2024-08-29 03:26:04 +02:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
2024-03-06 13:22:22 +01:00
|
|
|
|
2024-03-04 19:05:30 +01:00
|
|
|
services.paperless = {
|
|
|
|
enable = true;
|
2024-03-09 16:50:33 +01:00
|
|
|
address = "0.0.0.0";
|
2024-11-24 09:21:15 +01:00
|
|
|
package = pkgs.paperless-ngx.overrideAttrs (old: rec {
|
|
|
|
version = "2.13.4";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "paperless-ngx";
|
|
|
|
repo = "paperless-ngx";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-db8omhyngvenAgfGGpMAhGkgqGug/sv7AL1G+sniM/c=";
|
|
|
|
};
|
|
|
|
});
|
2024-05-27 19:10:54 +02:00
|
|
|
settings = {
|
2024-03-18 21:00:48 +01:00
|
|
|
PAPERLESS_OCR_LANGUAGE = "deu+eng";
|
|
|
|
PAPERLESS_APP_TITLE = "paperless.chungus.private";
|
2024-08-29 03:26:04 +02:00
|
|
|
PAPERLESS_CONSUMER_IGNORE_PATTERN = builtins.toJSON [
|
|
|
|
".DS_STORE/*"
|
|
|
|
"desktop.ini"
|
|
|
|
];
|
2024-05-15 22:54:12 +02:00
|
|
|
PAPERLESS_EMAIL_TASK_CRON = "0 */8 * * *"; # “At minute 0 past every 8th hour.”
|
2024-10-23 07:40:23 +02:00
|
|
|
|
|
|
|
# https://github.com/paperless-ngx/paperless-ngx/discussions/4047#discussioncomment-7019544
|
|
|
|
# https://github.com/paperless-ngx/paperless-ngx/issues/7383
|
2024-11-05 09:45:42 +01:00
|
|
|
PAPERLESS_OCR_USER_ARGS = {
|
|
|
|
"invalidate_digital_signatures" = true;
|
|
|
|
};
|
2024-03-18 21:00:48 +01:00
|
|
|
};
|
2024-03-04 19:05:30 +01:00
|
|
|
};
|
2024-03-06 13:22:22 +01:00
|
|
|
|
2024-05-12 09:32:04 +02:00
|
|
|
services.permown."/var/lib/paperless/consume" = {
|
|
|
|
owner = "paperless";
|
|
|
|
group = "paperless";
|
|
|
|
directory-mode = "755";
|
|
|
|
file-mode = "640";
|
|
|
|
};
|
|
|
|
|
2024-03-06 13:22:22 +01:00
|
|
|
networking.firewall.interfaces.wg0.allowedTCPPorts = [ config.services.paperless.port ];
|
|
|
|
|
2024-03-04 19:05:30 +01:00
|
|
|
services.nginx.virtualHosts."paperless.${config.networking.hostName}.private" = {
|
2024-05-22 09:28:11 +02:00
|
|
|
serverAliases = [ "paperless.ingolf-wagner.de" ];
|
2024-03-04 19:05:30 +01:00
|
|
|
extraConfig = ''
|
|
|
|
allow ${config.tinc.private.subnet};
|
2024-05-22 09:28:11 +02:00
|
|
|
allow ${config.wireguard.wg0.subnet};
|
2024-03-04 19:05:30 +01:00
|
|
|
deny all;
|
|
|
|
'';
|
|
|
|
locations."/" = {
|
2024-05-12 09:32:04 +02:00
|
|
|
extraConfig = ''
|
|
|
|
client_max_body_size 500M;
|
|
|
|
'';
|
2024-03-04 19:05:30 +01:00
|
|
|
proxyPass = "http://localhost:${toString config.services.paperless.port}";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
2024-10-06 02:40:42 +02:00
|
|
|
|
2024-03-04 19:05:30 +01:00
|
|
|
}
|