From b3a84f85bd658c19afdcd29ba507accd69bf31c5 Mon Sep 17 00:00:00 2001 From: cfjqve <206098865+cfjqve@users.noreply.github.com> Date: Fri, 14 Aug 2026 23:52:12 +0000 Subject: [PATCH] healthchecks: django compress before collectstatic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, collectstatic was called before compress, causing it to miss certain libraries (namely moment.js) that prevent the Events list from displaying properly. This also matches the suggested order in the healthchecks documentation: > Management commands that need to be run during each version upgrade. > - manage.py compress – creates combined JS and CSS bundles and places them in the static-collected directory. > - manage.py collectstatic – collects static files in the static-collected directory. --- nixos/modules/services/web-apps/healthchecks.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/web-apps/healthchecks.nix b/nixos/modules/services/web-apps/healthchecks.nix index f6c8a43cd329..ca088ac0d5a1 100644 --- a/nixos/modules/services/web-apps/healthchecks.nix +++ b/nixos/modules/services/web-apps/healthchecks.nix @@ -239,11 +239,14 @@ in serviceConfig = commonConfig // { Restart = "always"; - ExecStartPre = [ - "${pkg}/opt/healthchecks/manage.py collectstatic --no-input" - "${pkg}/opt/healthchecks/manage.py remove_stale_contenttypes --no-input" - ] - ++ lib.optionals (cfg.settings.DEBUG != "True") [ "${pkg}/opt/healthchecks/manage.py compress" ]; + ExecStartPre = + lib.optionals (cfg.settings.DEBUG != "True") [ + "${pkg}/opt/healthchecks/manage.py compress" + ] + ++ [ + "${pkg}/opt/healthchecks/manage.py collectstatic --no-input" + "${pkg}/opt/healthchecks/manage.py remove_stale_contenttypes --no-input" + ]; ExecStart = '' ${pkgs.python3Packages.gunicorn}/bin/gunicorn hc.wsgi \ --bind ${cfg.listenAddress}:${toString cfg.port} \