nixos: services: paperless: use automatic DB setup
That way I don't have to worry about the `postgresql.service` dependency anymore :-).
This commit is contained in:
parent
cb5eb68d35
commit
c5a375d165
|
@ -61,11 +61,6 @@ in
|
||||||
PAPERLESS_ENABLE_HTTP_REMOTE_USER = true;
|
PAPERLESS_ENABLE_HTTP_REMOTE_USER = true;
|
||||||
PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME = "HTTP_X_USER";
|
PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME = "HTTP_X_USER";
|
||||||
|
|
||||||
# Use PostgreSQL
|
|
||||||
PAPERLESS_DBHOST = "/run/postgresql";
|
|
||||||
PAPERLESS_DBUSER = "paperless";
|
|
||||||
PAPERLESS_DBNAME = "paperless";
|
|
||||||
|
|
||||||
# Security settings
|
# Security settings
|
||||||
PAPERLESS_ALLOWED_HOSTS = paperlessDomain;
|
PAPERLESS_ALLOWED_HOSTS = paperlessDomain;
|
||||||
PAPERLESS_CORS_ALLOWED_HOSTS = "https://${paperlessDomain}";
|
PAPERLESS_CORS_ALLOWED_HOSTS = "https://${paperlessDomain}";
|
||||||
|
@ -87,40 +82,11 @@ in
|
||||||
|
|
||||||
# Secret key
|
# Secret key
|
||||||
environmentFile = cfg.secretKeyFile;
|
environmentFile = cfg.secretKeyFile;
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services = {
|
# Automatic PostgreSQL provisioning
|
||||||
paperless-scheduler = {
|
database = {
|
||||||
requires = [ "postgresql.service" ];
|
createLocally = true;
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
paperless-consumer = {
|
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
paperless-web = {
|
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
paperless-task-queue = {
|
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Set-up database
|
|
||||||
services.postgresql = {
|
|
||||||
enable = true;
|
|
||||||
ensureDatabases = [ "paperless" ];
|
|
||||||
ensureUsers = [
|
|
||||||
{
|
|
||||||
name = "paperless";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set-up media group
|
# Set-up media group
|
||||||
|
|
Loading…
Reference in a new issue