feat: init paperless for winters

This commit is contained in:
Swarsel 2024-10-04 18:05:04 +02:00
parent a0a0f6e537
commit 3a56b30a91
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
6 changed files with 114 additions and 13 deletions

View file

@ -0,0 +1,48 @@
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.swarselsystems.server.immich {
users.users.paperless = {
extraGroups = [ "users" ];
};
sops.secrets.paperless_admin = { owner = "paperless"; };
services.paperless = {
enable = true;
mediaDir = "/Vault/Eternor/Dokumente";
user = "paperless";
port = 28981;
passwordFile = config.sops.secrets.paperless_admin.path;
address = "0.0.0.0";
extraConfig = {
PAPERLESS_OCR_LANGUAGE = "deu+eng";
PAPERLESS_URL = "scan.swarsel.win";
PAPERLESS_OCR_USER_ARGS = builtins.toJSON {
optimize = 1;
pdfa_image_compression = "lossless";
};
};
};
services.nginx = {
virtualHosts = {
"scan.swarsel.win" = {
enableACME = true;
forceSSL = true;
acmeRoot = null;
locations = {
"/" = {
proxyPass = "http://192.168.1.2:28981";
extraConfig = ''
client_max_body_size 0;
'';
};
};
};
};
};
};
}