diff --git a/nixos/modules/services/web-apps/flarum.nix b/nixos/modules/services/web-apps/flarum.nix index 95ebcc23e7e8..129f5a282681 100644 --- a/nixos/modules/services/web-apps/flarum.nix +++ b/nixos/modules/services/web-apps/flarum.nix @@ -203,10 +203,13 @@ in { ln -sf ${cfg.package}/share/php/flarum/public/index.php public/ '' + optionalString (cfg.createDatabaseLocally && cfg.database.driver == "mysql") '' if [ ! -f config.php ]; then - php flarum install --file=${flarumInstallConfig} + php flarum install --file=${flarumInstallConfig} + fi + '' + '' + if [ -f config.php ]; then + php flarum migrate + php flarum cache:clear fi - php flarum migrate - php flarum cache:clear ''; }; };