nur-update: fix gunicorn service

This commit is contained in:
Jörg Thalheim 2022-12-23 09:41:47 +01:00
parent 32c6762a14
commit 1264a5ac2d

View file

@ -9,14 +9,19 @@
sops.secrets.nur-update-github-token = { };
systemd.services.nur-update = {
description = "nur-update service";
systemd.services.nur-update = let
python = pkgs.python3.withPackages
(ps: with ps; [
(ps.toPythonModule nur-update.packages.${pkgs.system}.default)
gunicorn
]);
in {
description = "nur-update";
script = ''
GITHUB_TOKEN="$(<$CREDENTIALS_DIRECTORY/github-token)" \
${lib.getExe pkgs.python3.pkgs.gunicorn} nur_update:app \
${python}/bin/gunicorn nur_update:app \
--bind unix:/run/nur-update/gunicorn.sock \
--log-level info \
--python-path ${nur-update.packages.${pkgs.system}.default} \
--timeout 30 \
--workers 3
'';