nixos-config/nixos/machines/chungus/service-paperless.nix

40 lines
1.2 KiB
Nix
Raw Normal View History

2024-03-18 21:00:48 +01:00
{ config, pkgs, nixos-artwork, ... }: {
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-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";
PAPERLESS_CONSUMER_IGNORE_PATTERN = builtins.toJSON [ ".DS_STORE/*" "desktop.ini" ];
PAPERLESS_EMAIL_TASK_CRON = "0 */8 * * *"; # “At minute 0 past every 8th hour.”
2024-05-22 20:54:36 +02:00
#PAPERLESS_CONSUMER_DELETE_DUPLICATES = false;
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;
};
};
}