From db230657fce0f8cf0c5bbee490bbef3dc84ab8dc Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 14 May 2023 23:12:50 +0200 Subject: [PATCH] nixos/pixelfed: cleanup package cache at the very start --- nixos/modules/services/web-apps/pixelfed.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/web-apps/pixelfed.nix b/nixos/modules/services/web-apps/pixelfed.nix index b0c92aac979f..ada8465c4fee 100644 --- a/nixos/modules/services/web-apps/pixelfed.nix +++ b/nixos/modules/services/web-apps/pixelfed.nix @@ -380,6 +380,12 @@ in { }; script = '' + # Before running any PHP program, cleanup the bootstrap. + # It's necessary if you upgrade the application otherwise you might + # try to import non-existent modules. + rm -f ${cfg.runtimeDir}/bootstrap/app.php + rm -rf ${cfg.runtimeDir}/bootstrap/cache/* + # Concatenate non-secret .env and secret .env rm -f ${cfg.dataDir}/.env cp --no-preserve=all ${configFile} ${cfg.dataDir}/.env @@ -406,11 +412,6 @@ in { # Install Horizon # FIXME: require write access to public/ — should be done as part of install — pixelfed-manage horizon:publish - # Before running any PHP program, cleanup the bootstrap. - # It's necessary if you upgrade the application otherwise you might - # try to import non-existent modules. - rm -rf ${cfg.runtimeDir}/bootstrap/* - # Perform the first migration. [[ ! -f ${cfg.dataDir}/.initial-migration ]] && pixelfed-manage migrate --force && touch ${cfg.dataDir}/.initial-migration