aboutsummaryrefslogtreecommitdiff
path: root/modules/apps
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2016-10-20 14:47:17 +0300
committerIgor Pashev <pashev.igor@gmail.com>2016-10-20 15:11:06 +0300
commit72b6a27b9203314bfae04232072de296625f7a6a (patch)
tree3b75cf24e58d332d34b3b487d66e4832e28e04d5 /modules/apps
parent4f038741c388c88b0bbbc163ee62ccd44a720172 (diff)
downloadnixsap-72b6a27b9203314bfae04232072de296625f7a6a.tar.gz
mariadb: let loading arbitrary plugins
unix_socket is still always loaded. Example: nixsap.apps.mariadb.mysqld = { plugin_load_add = [ "ha_tokudb" "server_audit.so" ]; };
Diffstat (limited to 'modules/apps')
-rw-r--r--modules/apps/mariadb/default.nix12
-rw-r--r--modules/apps/mariadb/mysqld.nix1
2 files changed, 8 insertions, 5 deletions
diff --git a/modules/apps/mariadb/default.nix b/modules/apps/mariadb/default.nix
index 058eaa8..1c366ae 100644
--- a/modules/apps/mariadb/default.nix
+++ b/modules/apps/mariadb/default.nix
@@ -43,8 +43,10 @@ let
showList (mapAttrsToList (n: v:
"${n}=${if v then "on" else "off"}"
) (explicit a));
+ plugin_load_add = aa: concatMapStringsSep "\n" (l: "plugin_load_add = ${l}") (unique aa);
in if hasPrefix "skip" name then (optionalString value name)
else if name == "optimizer_switch" then "${name} = ${optimizer_switch value}"
+ else if name == "plugin_load_add" then plugin_load_add value
else if isBool value then "${name} = ${if value then "ON" else "OFF"}"
else if isInt value then "${name} = ${toString value}"
else if isList value then "${name} = ${showList value}"
@@ -92,11 +94,11 @@ let
then throw "Misconfigured slave: server_id was not set to a positive integer"
else pkgs.writeText "mysqld.cnf" ''
[mysqld]
- basedir = ${cfg.package}
- init_file = ${initFile}
- pid_file = ${rundir}/mysqld.pid
- plugin_load = unix_socket=auth_socket.so
- plugin_load_add = server_audit=server_audit.so
+ basedir = ${cfg.package}
+ init_file = ${initFile}
+ pid_file = ${rundir}/mysqld.pid
+ plugin_load = auth_socket
+
${concatNonEmpty "\n" (mapAttrsToList mkEntry (explicit cfg.mysqld))}
${optionalString hasMasters "!include ${replCnf}"}
'';
diff --git a/modules/apps/mariadb/mysqld.nix b/modules/apps/mariadb/mysqld.nix
index edcc75b..f8753a8 100644
--- a/modules/apps/mariadb/mysqld.nix
+++ b/modules/apps/mariadb/mysqld.nix
@@ -220,6 +220,7 @@ in {
net_read_timeout = optional int;
net_write_timeout = optional int;
optimizer_switch = set optimizer;
+ plugin_load_add = default [] (listOf str);
port = default 3306 int;
query_alloc_block_size = optional int;
query_cache_limit = optional int;