diff --git a/modules/flarum.nix b/modules/flarum.nix index 86a8e7b0..9f8bab4d 100644 --- a/modules/flarum.nix +++ b/modules/flarum.nix @@ -13,7 +13,7 @@ let opt = options.services.flarum; 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' => @@ -21,15 +21,15 @@ let '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' => 'root', // database username - 'password' => \'\', + '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 + '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://flarum.localhost', // the URL installation, you will want to change this if you change domains + '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 @@ -147,6 +147,7 @@ in { "pm.start_servers" = mkDefault 2; "pm.min_spare_servers" = mkDefault 1; "pm.max_spare_servers" = mkDefault 3; + "error_log" = "syslog"; }; }; @@ -202,13 +203,13 @@ in { ln -sf ${cfg.package}/build/vendor . ln -sf ${cfg.package}/build/public/index.php public/ chmod a+x . public - ''; - # + lib.optionalString - # (cfg.createDatabaseLocally && cfg.database.driver == "mysql") '' - # cp ${flarumInstallConfig} . - # php flarum migrate - # php flarum cache:clear - # ''; + '' + + lib.optionalString + (cfg.createDatabaseLocally && cfg.database.driver == "mysql") '' + cp ${flarumInstallConfig} ${cfg.stateDir}/config.php + php flarum cache:clear + ''; + # php flarum migrate }; }; }