mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-12 05:16:25 +03:00
mysql module: cleanup obsolete checks
This commit is contained in:
parent
88657b3a50
commit
86c7db0ac4
1 changed files with 4 additions and 13 deletions
|
@ -7,14 +7,12 @@ let
|
||||||
cfg = config.services.mysql;
|
cfg = config.services.mysql;
|
||||||
|
|
||||||
mysql = cfg.package;
|
mysql = cfg.package;
|
||||||
|
|
||||||
isMariaDB =
|
isMariaDB =
|
||||||
let
|
let
|
||||||
pName = _p: (builtins.parseDrvName (_p.name)).name;
|
pName = _p: (builtins.parseDrvName (_p.name)).name;
|
||||||
in pName mysql == pName pkgs.mariadb;
|
in pName mysql == pName pkgs.mariadb;
|
||||||
|
|
||||||
atLeast55 = versionAtLeast mysql.mysqlVersion "5.5";
|
|
||||||
|
|
||||||
pidFile = "${cfg.pidDir}/mysqld.pid";
|
pidFile = "${cfg.pidDir}/mysqld.pid";
|
||||||
|
|
||||||
mysqldOptions =
|
mysqldOptions =
|
||||||
|
@ -28,13 +26,6 @@ let
|
||||||
${optionalString (cfg.bind != null) "bind-address = ${cfg.bind}" }
|
${optionalString (cfg.bind != null) "bind-address = ${cfg.bind}" }
|
||||||
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "log-bin=mysql-bin"}
|
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "log-bin=mysql-bin"}
|
||||||
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "server-id = ${toString cfg.replication.serverId}"}
|
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "server-id = ${toString cfg.replication.serverId}"}
|
||||||
${optionalString (cfg.replication.role == "slave" && !atLeast55)
|
|
||||||
''
|
|
||||||
master-host = ${cfg.replication.masterHost}
|
|
||||||
master-user = ${cfg.replication.masterUser}
|
|
||||||
master-password = ${cfg.replication.masterPassword}
|
|
||||||
master-port = ${toString cfg.replication.masterPort}
|
|
||||||
''}
|
|
||||||
${optionalString (cfg.ensureUsers != [])
|
${optionalString (cfg.ensureUsers != [])
|
||||||
''
|
''
|
||||||
plugin-load-add = auth_socket.so
|
plugin-load-add = auth_socket.so
|
||||||
|
@ -315,7 +306,7 @@ in
|
||||||
fi
|
fi
|
||||||
'') cfg.initialDatabases}
|
'') cfg.initialDatabases}
|
||||||
|
|
||||||
${optionalString (cfg.replication.role == "master" && atLeast55)
|
${optionalString (cfg.replication.role == "master")
|
||||||
''
|
''
|
||||||
# Set up the replication master
|
# Set up the replication master
|
||||||
|
|
||||||
|
@ -326,7 +317,7 @@ in
|
||||||
) | ${mysql}/bin/mysql -u root -N
|
) | ${mysql}/bin/mysql -u root -N
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (cfg.replication.role == "slave" && atLeast55)
|
${optionalString (cfg.replication.role == "slave")
|
||||||
''
|
''
|
||||||
# Set up the replication slave
|
# Set up the replication slave
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue