Skip to content

Commit

Permalink
Merge pull request #125821 from NixOS/backport-125699-to-release-21.05
Browse files Browse the repository at this point in the history
[Backport release-21.05] treewide: Fix mysql alias deprecation breakage
  • Loading branch information
talyz authored Jun 6, 2021
2 parents ff58024 + a60818c commit 64393da
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions nixos/modules/services/backup/mysql-backup.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ with lib;

let

inherit (pkgs) mysql gzip;
inherit (pkgs) mariadb gzip;

cfg = config.services.mysqlBackup;
defaultUser = "mysqlbackup";
Expand All @@ -20,7 +20,7 @@ let
'';
backupDatabaseScript = db: ''
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
echo "Backed up to $dest"
else
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/databases/mysql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ in

package = mkOption {
type = types.package;
example = literalExample "pkgs.mysql";
example = literalExample "pkgs.mariadb";
description = "
Which MySQL derivation to use. MariaDB packages are supported too.
";
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/video/epgstation/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let
# NOTE: Use password authentication, since mysqljs does not yet support auth_socket
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';"
touch /var/lib/epgstation/db-created
fi
Expand Down Expand Up @@ -224,7 +224,7 @@ in

services.mysql = {
enable = mkDefault true;
package = mkDefault pkgs.mysql;
package = mkDefault pkgs.mariadb;
ensureDatabases = [ cfg.database.name ];
# FIXME: enable once mysqljs supports auth_socket
# ensureUsers = [ {
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/web-apps/keycloak.nix
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ in

services.postgresql.enable = lib.mkDefault createLocalPostgreSQL;
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;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/web-apps/tt-rss.nix
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ let

services.mysql = mkIf mysqlLocal {
enable = true;
package = mkDefault pkgs.mysql;
package = mkDefault pkgs.mariadb;
ensureDatabases = [ cfg.database.name ];
ensureUsers = [
{
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/bitwarden.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let
GRANT ALL ON `bitwarden`.* TO 'bitwardenuser'@'localhost';
FLUSH PRIVILEGES;
'';
package = pkgs.mysql;
package = pkgs.mariadb;
};

services.bitwarden_rs.config.databaseUrl = "mysql://bitwardenuser:${dbPassword}@localhost/bitwarden";
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/matomo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let
};
services.mysql = {
enable = true;
package = pkgs.mysql;
package = pkgs.mariadb;
};
services.nginx.enable = true;
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/mysql/mysql-autobackup.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ./../make-test-python.nix ({ pkgs, lib, ... }:
{ pkgs, ... }:
{
services.mysql.enable = true;
services.mysql.package = pkgs.mysql;
services.mysql.package = pkgs.mariadb;
services.mysql.initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];

services.automysqlbackup.enable = true;
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/mysql/mysql-backup.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ./../make-test-python.nix ({ pkgs, ... } : {
services.mysql = {
enable = true;
initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];
package = pkgs.mysql;
package = pkgs.mariadb;
};

services.mysqlBackup = {
Expand Down
6 changes: 3 additions & 3 deletions nixos/tests/mysql/mysql-replication.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in

{
services.mysql.enable = true;
services.mysql.package = pkgs.mysql;
services.mysql.package = pkgs.mariadb;
services.mysql.replication.role = "master";
services.mysql.replication.slaveHost = "%";
services.mysql.replication.masterUser = replicateUser;
Expand All @@ -31,7 +31,7 @@ in

{
services.mysql.enable = true;
services.mysql.package = pkgs.mysql;
services.mysql.package = pkgs.mariadb;
services.mysql.replication.role = "slave";
services.mysql.replication.serverId = 2;
services.mysql.replication.masterHost = nodes.master.config.networking.hostName;
Expand All @@ -44,7 +44,7 @@ in

{
services.mysql.enable = true;
services.mysql.package = pkgs.mysql;
services.mysql.package = pkgs.mariadb;
services.mysql.replication.role = "slave";
services.mysql.replication.serverId = 3;
services.mysql.replication.masterHost = nodes.master.config.networking.hostName;
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/sogo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {

services.mysql = {
enable = true;
package = pkgs.mysql;
package = pkgs.mariadb;
ensureDatabases = [ "sogo" ];
ensureUsers = [{
name = "sogo";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/lua-modules/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ with super;
MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql";
};
buildInputs = [
pkgs.mysql.client
pkgs.mariadb.client
pkgs.libmysqlclient
];
});
Expand Down

0 comments on commit 64393da

Please sign in to comment.