{ config, lib, ... }: { imports = [ ./proxy.nix ./database.nix ./fail2ban.nix ./impermanence.nix ]; options.services.paperless = { database = { user = lib.mkOption { type = lib.types.str; description = "what is the user and database that we are going to use for paperless"; default = "paperless"; }; }; }; config = lib.mkIf config.services.paperless.enable { services.paperless = { domain = "${config.services.paperless.subdomain}.${config.host.reverse_proxy.hostname}"; configureTika = true; settings = { PAPERLESS_DBENGINE = "postgresql"; PAPERLESS_DBHOST = "/run/postgresql"; PAPERLESS_DBNAME = config.services.paperless.database.user; PAPERLESS_DBUSER = config.services.paperless.database.user; }; }; }; }