summaryrefslogtreecommitdiff
path: root/hosts/vidhar/paperless/default.nix
blob: 34cd18c4daaa20d337cb512c13e9947cb43c740b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ config, ... }:

{
  config = {
    services.paperless = {
      enable = true;
      address = "[2a03:4000:52:ada:4:1::]";
      passwordFile = config.sops.secrets."paperless-rootpw".path;
      settings = {
        PAPERLESS_OCR_LANGUAGE = "deu+eng";
        PAPERLESS_URL = "https://paperless.yggdrasil.li";
        PAPERLESS_FILENAME_FORMAT = "{{ created_year }}/{{ document_type }}/{{ correspondent }}/{{ created }}_{{ doc_pk }}_{{ title }}";
        PAPERLESS_FILENAME_FORMAT_REMOVE_NONE = "true";
        PAPERLESS_TASK_WORKERS = "3";
        PAPERLESS_THREADS_PER_WORKER = "4";
      };
      database.createLocally = true;
    };

    sops.secrets."paperless-rootpw" = {
      format = "binary";
      sopsFile = ./rootpw;
    };
  };
}