Add database to web dev stack on hikari

This commit is contained in:
Daniel Siepmann 2023-02-02 15:57:08 +01:00
parent 1aa49f0eff
commit b1c8090b58
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 45 additions and 0 deletions

View file

@ -27,5 +27,44 @@
'';
};
};
mysql = {
enable = true;
package = pkgs.mariadb;
ensureUsers = [
{
name = "daniels";
ensurePermissions = {
"*.*" = "ALL PRIVILEGES";
};
}
{
# INITIALLY once change dev user to be identified by password
name = "dev";
ensurePermissions = {
# TODO: Auto build from defined databases?!
"own_danielsiepmann.*" = "ALL PRIVILEGES";
};
}
];
ensureDatabases = [
"testing" # Used by TYPO3 functional tests
"testing_at" # Used by TYPO3 Acceptance tests
];
settings = {
mysqld = {
# sql_mode = "SRTICT_TRANS_TABLES;NO_ZERO_IN_DATE;NO_ZERO_DATE;ERROR_FOR_DIVISION_BY_ZERO;NO_ENGINE_SUBSTITUTION";
general_log = true;
general_log_file = "/var/lib/mysql/query.log";
bind-address = "127.0.0.1";
# = "/var/log/mysql/query.log";
};
};
};
};
}

View file

@ -3,6 +3,7 @@
let
domain = "daniel-siepmann.localhost";
documentRoot = "/var/projects/own/daniel-siepmann.de/project/public/";
databaseName = "own_danielsiepmann";
in {
services = {
httpd.virtualHosts.${domain} = {
@ -76,10 +77,15 @@ in {
"listen.group" = config.services.httpd.group;
"pm" = "static";
"pm.max_children" = 15;
"php_admin_value[max_execution_time]" = 240;
"php_admin_value[max_input_vars]" = 1500;
};
phpEnv = {
TYPO3_ADDITIONAL_CONFIGURATION = "/var/projects/own/typo3-configuration/AdditionalConfiguration.inc.php";
TYPO3_DATABASE = databaseName;
TYPO3_CONTEXT = "Development/dsiepmann";
};
};
mysql.ensureDatabases = [databaseName];
};
}