gnu: services: Allow extra content in mysql configuration.

* gnu/services/databases.scm (<mysql-configuration>): New field.
  (mysql-configuration-file): Use it.
This commit is contained in:
Alex Sassmannshausen 2020-01-16 17:17:48 +01:00
parent bd843a2ff6
commit 33ed8296c0
No known key found for this signature in database
GPG key ID: 8BC4F4476E8A8E00

View file

@ -463,7 +463,8 @@ (define-record-type* <mysql-configuration>
mysql-configuration make-mysql-configuration mysql-configuration make-mysql-configuration
mysql-configuration? mysql-configuration?
(mysql mysql-configuration-mysql (default mariadb)) (mysql mysql-configuration-mysql (default mariadb))
(port mysql-configuration-port (default 3306))) (port mysql-configuration-port (default 3306))
(extra-content mysql-configuration-extra-content (default "")))
(define %mysql-accounts (define %mysql-accounts
(list (user-group (list (user-group
@ -478,11 +479,12 @@ (define %mysql-accounts
(define mysql-configuration-file (define mysql-configuration-file
(match-lambda (match-lambda
(($ <mysql-configuration> mysql port) (($ <mysql-configuration> mysql port extra-content)
(mixed-text-file "my.cnf" "[mysqld] (mixed-text-file "my.cnf" "[mysqld]
datadir=/var/lib/mysql datadir=/var/lib/mysql
socket=/run/mysqld/mysqld.sock socket=/run/mysqld/mysqld.sock
port=" (number->string port) " port=" (number->string port) "
" extra-content "
")))) "))))
(define (%mysql-activation config) (define (%mysql-activation config)