From 9797415f0c335e97a25ef5b08bfa2a540d1a7815 Mon Sep 17 00:00:00 2001 From: shokinn Date: Tue, 8 Jul 2025 23:11:37 +0200 Subject: [PATCH] Add build phase to compile localization messages during the build process --- flake.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 7e2d03b..6819261 100644 --- a/flake.nix +++ b/flake.nix @@ -313,6 +313,16 @@ cp ${settingsLocal} bitpoll/settings_local.py ''; + buildPhase = '' + runHook preBuild + + # Compile localization messages during build to avoid runtime write issues + export PYTHONPATH=$PWD:$PYTHONPATH + ${pythonEnv}/bin/python manage.py compilemessages + + runHook postBuild + ''; + installPhase = '' runHook preInstall @@ -482,9 +492,6 @@ # Collect static files ${cfg.package}/bin/bitpoll-manage collectstatic --noinput --clear - - # Compile messages - ${cfg.package}/bin/bitpoll-manage compilemessages ''; serviceConfig = {