Skip to content

Commit

Permalink
flarum: use upstream config.php
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Leightcap <[email protected]>
  • Loading branch information
jleightcap committed Sep 12, 2023
1 parent eb9fb03 commit 1e9487f
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions modules/flarum.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,28 @@ let

flarumInstallConfig = pkgs.writeText "config.php" ''
<?php return array (
'debug' => 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 = {
Expand Down Expand Up @@ -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
};
};
}

0 comments on commit 1e9487f

Please sign in to comment.