Skip to content

Commit

Permalink
nixos/paperless: Add database.isRemote option
Browse files Browse the repository at this point in the history
When the database is on another host, unit isolation for the document
consumer has to be disabled.
  • Loading branch information
Gerd Flaig committed Dec 26, 2024
1 parent c6bc263 commit 32811fb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nixos/modules/services/misc/paperless.nix
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ in
Configure local PostgreSQL database server for Paperless.
'';
};
isRemote = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Database server is remote over the network. This will disable network isolation of
the document consumer.
'';
};
};
};

Expand Down Expand Up @@ -298,6 +306,7 @@ in
ExecStart = "${cfg.package}/bin/celery --app paperless beat --loglevel INFO";
Restart = "on-failure";
LoadCredential = lib.optionalString (cfg.passwordFile != null) "PAPERLESS_ADMIN_PASSWORD:${cfg.passwordFile}";
PrivateNetwork = lib.mkIf cfg.database.isRemote false;
};
environment = env;

Expand Down Expand Up @@ -374,6 +383,7 @@ in
User = cfg.user;
ExecStart = "${cfg.package}/bin/paperless-ngx document_consumer";
Restart = "on-failure";
PrivateNetwork = lib.mkIf cfg.database.isRemote false;
};
environment = env;
# Allow the consumer to access the private /tmp directory of the server.
Expand Down

0 comments on commit 32811fb

Please sign in to comment.