Merge pull request #207754 from leona-ya/paperless-ngx/fix-module-1.10.2

fixes https://github.com/NixOS/nixpkgs/issues/207965
This commit is contained in:
Sandro 2022-12-28 01:05:49 +01:00 committed by GitHub
commit ad8ae1b208
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 8 deletions

View file

@ -211,19 +211,15 @@ in
];
systemd.services.paperless-scheduler = {
description = "Paperless scheduler";
description = "Paperless Celery Beat";
serviceConfig = defaultServiceConfig // {
User = cfg.user;
ExecStart = "${pkg}/bin/paperless-ngx qcluster";
ExecStart = "${pkg}/bin/celery --app paperless beat --loglevel INFO";
Restart = "on-failure";
# The `mbind` syscall is needed for running the classifier.
SystemCallFilter = defaultServiceConfig.SystemCallFilter ++ [ "mbind" ];
# Needs to talk to mail server for automated import rules
PrivateNetwork = false;
};
environment = env;
wantedBy = [ "multi-user.target" ];
wants = [ "paperless-consumer.service" "paperless-web.service" ];
wants = [ "paperless-consumer.service" "paperless-web.service" "paperless-task-queue.service" ];
preStart = ''
ln -sf ${manage} ${cfg.dataDir}/paperless-manage
@ -250,6 +246,20 @@ in
after = [ "redis-paperless.service" ];
};
systemd.services.paperless-task-queue = {
description = "Paperless Celery Workers";
serviceConfig = defaultServiceConfig // {
User = cfg.user;
ExecStart = "${pkg}/bin/celery --app paperless worker --loglevel INFO";
Restart = "on-failure";
# The `mbind` syscall is needed for running the classifier.
SystemCallFilter = defaultServiceConfig.SystemCallFilter ++ [ "mbind" ];
# Needs to talk to mail server for automated import rules
PrivateNetwork = false;
};
environment = env;
};
# Reading the user-provided password file requires root access
systemd.services.paperless-copy-password = mkIf (cfg.passwordFile != null) {
requiredBy = [ "paperless-scheduler.service" ];
@ -301,7 +311,7 @@ in
};
# Allow the web interface to access the private /tmp directory of the server.
# This is required to support uploading files via the web interface.
unitConfig.JoinsNamespaceOf = "paperless-scheduler.service";
unitConfig.JoinsNamespaceOf = "paperless-task-queue.service";
# Bind to `paperless-scheduler` so that the web server never runs
# during migrations
bindsTo = [ "paperless-scheduler.service" ];

View file

@ -200,6 +200,9 @@ python.pkgs.pythonPackages.buildPythonApplication rec {
makeWrapper $out/lib/paperless-ngx/src/manage.py $out/bin/paperless-ngx \
--prefix PYTHONPATH : "$PYTHONPATH" \
--prefix PATH : "${path}"
makeWrapper ${python.pkgs.celery}/bin/celery $out/bin/celery \
--prefix PYTHONPATH : "$PYTHONPATH:$out/lib/paperless-ngx/src" \
--prefix PATH : "${path}"
'';
checkInputs = with python.pkgs.pythonPackages; [