diff --git a/modules/flarum.nix b/modules/flarum.nix index b2a65cd6..8ed930c0 100644 --- a/modules/flarum.nix +++ b/modules/flarum.nix @@ -14,29 +14,28 @@ let flarumInstallConfig = pkgs.writeText "config.php" '' false, // enables or disables debug mode, used to troubleshoot issues - 'offline' => false, // enables or disables site maintenance mode. This makes your site inaccessible to all users (including admins). - 'database' => - array ( - 'driver' => 'mysql', // the database driver, i.e. MySQL, MariaDB... - 'host' => 'localhost', // the host of the connection, localhost in most cases unless using an external service - 'database' => 'flarum', // the name of the database in the instance - 'username' => 'flarum', // database username - 'password' => ' ', - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => ' ', // the prefix for the tables, useful if you are sharing the same database with another service - 'port' => '3306', // the port of the connection, defaults to 3306 with MySQL - 'strict' => false, - ), - 'url' => 'http://localhost', // the URL installation, you will want to change this if you change domains - 'paths' => - array ( - 'api' => 'api', // /api goes to the API - 'admin' => 'admin', // /admin goes to the admin - ), - ) - >; + 'debug' => true, // enables or disables debug mode, used to troubleshoot issues FIXME(jl): disable debug later? + 'offline' => false, // enables or disables site maintenance mode. This makes your site inaccessible to all users (including admins). + 'database' => + array ( + 'driver' => 'mysql', // the database driver, i.e. MySQL, MariaDB... + 'host' => 'localhost', // the host of the connection, localhost in most cases unless using an external service + 'database' => 'flarum', // the name of the database in the instance + 'username' => 'flarum', // database username + 'password' => "", // database password + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => "", // the prefix for the tables, useful if you are sharing the same database with another service + 'port' => '3306', // the port of the connection, defaults to 3306 with MySQL + 'strict' => false, + ), + 'url' => 'https://localhost', // the URL installation, you will want to change this if you change domains + 'paths' => + array ( + 'api' => 'api', // /api goes to the API + 'admin' => 'admin', // /admin goes to the admin + ), +); ''; in { options = { @@ -210,10 +209,9 @@ in { + lib.optionalString (cfg.createDatabaseLocally && cfg.database.driver == "mysql") '' cp ${flarumInstallConfig} ${cfg.stateDir}/config.php - exit 0 # FIXME(jl): exit early here, still need to fix php flarum cache - php flarum cache:clear + php flarum migrate + # php flarum cache:clear ''; - # php flarum migrate }; }; }