about summary refs log tree commit diff
path: root/modules/services/paperless.nix
blob: 8b2d6f286499feb176b099764dcc020f896fa991 (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
26
27
28
29
30
{ config, lib, ... }:

with lib;
let
  cfg = config.modules.services.paperless;
in
{
  options.modules.services.paperless = {
    enable = mkEnableOption "paperless";

    realHost = mkOption { type = types.str; };

    secrets = {
      paperless-superuser-password = mkOption { type = types.path; };
    };
  };

  config = mkIf cfg.enable {
    services.paperless = rec {
      enable = true;

      port = 4007;

      dataDir = "/smol/core/paperless";
      mediaDir = "${dataDir}/media";

      passwordFile = cfg.secrets.paperless-superuser-password;
    };
  };
}