paperless > http

This commit is contained in:
Danilo Reyes
2025-12-10 12:43:28 -06:00
parent 1ade9dd65a
commit e279e3811f

View File

@@ -1,17 +1,20 @@
{ lib, config, ... }:
let
cfg = config.my.servers.paperless;
port = config.services.paperless.port;
in
{
options.my.servers.paperless.enable = lib.mkEnableOption "Paperless-ngx document management system";
config = lib.mkIf (cfg.enable && config.my.servers.postgres.enable) {
networking.firewall.allowedTCPPorts = [ config.services.paperless.port ];
networking.firewall.allowedTCPPorts = [ port ];
services.paperless = {
inherit (cfg) enable;
address = "0.0.0.0";
address = config.my.ips.server;
consumptionDirIsPublic = true;
consumptionDir = "/srv/pool/scans/";
settings = {
PAPERLESS_ACCOUNT_DEFAULT_HTTP_PROTOCOL = "http";
PAPERLESS_URL = "http://${config.my.ips.server}:${builtins.toString port}";
PAPERLESS_DBENGINE = "postgress";
PAPERLESS_DBNAME = "paperless";
PAPERLESS_DBHOST = config.my.postgresSocket;