forked from mirrors/nixpkgs
treewide: Fix mysql alias deprecation breakage
62733b37b4
broke evaluation in all
places `pkgs.mysql` was used. Fix this by changing all occurrences to
`pkgs.mariadb`.
This commit is contained in:
parent
f36a65f6e2
commit
59e0120aa5
|
@ -4,7 +4,7 @@ with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (pkgs) mysql gzip;
|
inherit (pkgs) mariadb gzip;
|
||||||
|
|
||||||
cfg = config.services.mysqlBackup;
|
cfg = config.services.mysqlBackup;
|
||||||
defaultUser = "mysqlbackup";
|
defaultUser = "mysqlbackup";
|
||||||
|
@ -20,7 +20,7 @@ let
|
||||||
'';
|
'';
|
||||||
backupDatabaseScript = db: ''
|
backupDatabaseScript = db: ''
|
||||||
dest="${cfg.location}/${db}.gz"
|
dest="${cfg.location}/${db}.gz"
|
||||||
if ${mysql}/bin/mysqldump ${if cfg.singleTransaction then "--single-transaction" else ""} ${db} | ${gzip}/bin/gzip -c > $dest.tmp; then
|
if ${mariadb}/bin/mysqldump ${if cfg.singleTransaction then "--single-transaction" else ""} ${db} | ${gzip}/bin/gzip -c > $dest.tmp; then
|
||||||
mv $dest.tmp $dest
|
mv $dest.tmp $dest
|
||||||
echo "Backed up to $dest"
|
echo "Backed up to $dest"
|
||||||
else
|
else
|
||||||
|
|
|
@ -34,7 +34,7 @@ in
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
example = literalExample "pkgs.mysql";
|
example = literalExample "pkgs.mariadb";
|
||||||
description = "
|
description = "
|
||||||
Which MySQL derivation to use. MariaDB packages are supported too.
|
Which MySQL derivation to use. MariaDB packages are supported too.
|
||||||
";
|
";
|
||||||
|
|
|
@ -27,7 +27,7 @@ let
|
||||||
|
|
||||||
# NOTE: Use password authentication, since mysqljs does not yet support auth_socket
|
# NOTE: Use password authentication, since mysqljs does not yet support auth_socket
|
||||||
if [ ! -e /var/lib/epgstation/db-created ]; then
|
if [ ! -e /var/lib/epgstation/db-created ]; then
|
||||||
${pkgs.mysql}/bin/mysql -e \
|
${pkgs.mariadb}/bin/mysql -e \
|
||||||
"GRANT ALL ON \`${cfg.database.name}\`.* TO '${username}'@'localhost' IDENTIFIED by '$DB_PASSWORD';"
|
"GRANT ALL ON \`${cfg.database.name}\`.* TO '${username}'@'localhost' IDENTIFIED by '$DB_PASSWORD';"
|
||||||
touch /var/lib/epgstation/db-created
|
touch /var/lib/epgstation/db-created
|
||||||
fi
|
fi
|
||||||
|
@ -224,7 +224,7 @@ in
|
||||||
|
|
||||||
services.mysql = {
|
services.mysql = {
|
||||||
enable = mkDefault true;
|
enable = mkDefault true;
|
||||||
package = mkDefault pkgs.mysql;
|
package = mkDefault pkgs.mariadb;
|
||||||
ensureDatabases = [ cfg.database.name ];
|
ensureDatabases = [ cfg.database.name ];
|
||||||
# FIXME: enable once mysqljs supports auth_socket
|
# FIXME: enable once mysqljs supports auth_socket
|
||||||
# ensureUsers = [ {
|
# ensureUsers = [ {
|
||||||
|
|
|
@ -728,7 +728,7 @@ in
|
||||||
|
|
||||||
services.postgresql.enable = lib.mkDefault createLocalPostgreSQL;
|
services.postgresql.enable = lib.mkDefault createLocalPostgreSQL;
|
||||||
services.mysql.enable = lib.mkDefault createLocalMySQL;
|
services.mysql.enable = lib.mkDefault createLocalMySQL;
|
||||||
services.mysql.package = lib.mkIf createLocalMySQL pkgs.mysql;
|
services.mysql.package = lib.mkIf createLocalMySQL pkgs.mariadb;
|
||||||
};
|
};
|
||||||
|
|
||||||
meta.doc = ./keycloak.xml;
|
meta.doc = ./keycloak.xml;
|
||||||
|
|
|
@ -644,7 +644,7 @@ let
|
||||||
|
|
||||||
services.mysql = mkIf mysqlLocal {
|
services.mysql = mkIf mysqlLocal {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = mkDefault pkgs.mysql;
|
package = mkDefault pkgs.mariadb;
|
||||||
ensureDatabases = [ cfg.database.name ];
|
ensureDatabases = [ cfg.database.name ];
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,7 +42,7 @@ let
|
||||||
GRANT ALL ON `bitwarden`.* TO 'bitwardenuser'@'localhost';
|
GRANT ALL ON `bitwarden`.* TO 'bitwardenuser'@'localhost';
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
'';
|
'';
|
||||||
package = pkgs.mysql;
|
package = pkgs.mariadb;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.bitwarden_rs.config.databaseUrl = "mysql://bitwardenuser:${dbPassword}@localhost/bitwarden";
|
services.bitwarden_rs.config.databaseUrl = "mysql://bitwardenuser:${dbPassword}@localhost/bitwarden";
|
||||||
|
|
|
@ -18,7 +18,7 @@ let
|
||||||
};
|
};
|
||||||
services.mysql = {
|
services.mysql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.mysql;
|
package = pkgs.mariadb;
|
||||||
};
|
};
|
||||||
services.nginx.enable = true;
|
services.nginx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,7 +8,7 @@ import ./../make-test-python.nix ({ pkgs, lib, ... }:
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
services.mysql.enable = true;
|
services.mysql.enable = true;
|
||||||
services.mysql.package = pkgs.mysql;
|
services.mysql.package = pkgs.mariadb;
|
||||||
services.mysql.initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];
|
services.mysql.initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];
|
||||||
|
|
||||||
services.automysqlbackup.enable = true;
|
services.automysqlbackup.enable = true;
|
||||||
|
|
|
@ -10,7 +10,7 @@ import ./../make-test-python.nix ({ pkgs, ... } : {
|
||||||
services.mysql = {
|
services.mysql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];
|
initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];
|
||||||
package = pkgs.mysql;
|
package = pkgs.mariadb;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.mysqlBackup = {
|
services.mysqlBackup = {
|
||||||
|
|
|
@ -17,7 +17,7 @@ in
|
||||||
|
|
||||||
{
|
{
|
||||||
services.mysql.enable = true;
|
services.mysql.enable = true;
|
||||||
services.mysql.package = pkgs.mysql;
|
services.mysql.package = pkgs.mariadb;
|
||||||
services.mysql.replication.role = "master";
|
services.mysql.replication.role = "master";
|
||||||
services.mysql.replication.slaveHost = "%";
|
services.mysql.replication.slaveHost = "%";
|
||||||
services.mysql.replication.masterUser = replicateUser;
|
services.mysql.replication.masterUser = replicateUser;
|
||||||
|
@ -31,7 +31,7 @@ in
|
||||||
|
|
||||||
{
|
{
|
||||||
services.mysql.enable = true;
|
services.mysql.enable = true;
|
||||||
services.mysql.package = pkgs.mysql;
|
services.mysql.package = pkgs.mariadb;
|
||||||
services.mysql.replication.role = "slave";
|
services.mysql.replication.role = "slave";
|
||||||
services.mysql.replication.serverId = 2;
|
services.mysql.replication.serverId = 2;
|
||||||
services.mysql.replication.masterHost = nodes.master.config.networking.hostName;
|
services.mysql.replication.masterHost = nodes.master.config.networking.hostName;
|
||||||
|
@ -44,7 +44,7 @@ in
|
||||||
|
|
||||||
{
|
{
|
||||||
services.mysql.enable = true;
|
services.mysql.enable = true;
|
||||||
services.mysql.package = pkgs.mysql;
|
services.mysql.package = pkgs.mariadb;
|
||||||
services.mysql.replication.role = "slave";
|
services.mysql.replication.role = "slave";
|
||||||
services.mysql.replication.serverId = 3;
|
services.mysql.replication.serverId = 3;
|
||||||
services.mysql.replication.masterHost = nodes.master.config.networking.hostName;
|
services.mysql.replication.masterHost = nodes.master.config.networking.hostName;
|
||||||
|
|
|
@ -10,7 +10,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
||||||
|
|
||||||
services.mysql = {
|
services.mysql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.mysql;
|
package = pkgs.mariadb;
|
||||||
ensureDatabases = [ "sogo" ];
|
ensureDatabases = [ "sogo" ];
|
||||||
ensureUsers = [{
|
ensureUsers = [{
|
||||||
name = "sogo";
|
name = "sogo";
|
||||||
|
|
|
@ -173,7 +173,7 @@ with super;
|
||||||
MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql";
|
MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql";
|
||||||
};
|
};
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
pkgs.mysql.client
|
pkgs.mariadb.client
|
||||||
pkgs.libmysqlclient
|
pkgs.libmysqlclient
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue