From 59e0120aa5c1241d48048afa615e25c65d7e366d Mon Sep 17 00:00:00 2001 From: talyz Date: Fri, 4 Jun 2021 16:08:41 +0200 Subject: [PATCH] treewide: Fix mysql alias deprecation breakage 62733b37b4a866cabafe1fc8bb7415240126eb0b broke evaluation in all places `pkgs.mysql` was used. Fix this by changing all occurrences to `pkgs.mariadb`. --- nixos/modules/services/backup/mysql-backup.nix | 4 ++-- nixos/modules/services/databases/mysql.nix | 2 +- nixos/modules/services/video/epgstation/default.nix | 4 ++-- nixos/modules/services/web-apps/keycloak.nix | 2 +- nixos/modules/services/web-apps/tt-rss.nix | 2 +- nixos/tests/bitwarden.nix | 2 +- nixos/tests/matomo.nix | 2 +- nixos/tests/mysql/mysql-autobackup.nix | 2 +- nixos/tests/mysql/mysql-backup.nix | 2 +- nixos/tests/mysql/mysql-replication.nix | 6 +++--- nixos/tests/sogo.nix | 2 +- pkgs/development/lua-modules/overrides.nix | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/nixos/modules/services/backup/mysql-backup.nix b/nixos/modules/services/backup/mysql-backup.nix index 506ded5e9e8..9fca2100273 100644 --- a/nixos/modules/services/backup/mysql-backup.nix +++ b/nixos/modules/services/backup/mysql-backup.nix @@ -4,7 +4,7 @@ with lib; let - inherit (pkgs) mysql gzip; + inherit (pkgs) mariadb gzip; cfg = config.services.mysqlBackup; defaultUser = "mysqlbackup"; @@ -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 diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index cf105daeb04..2d8d613ed88 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -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. "; diff --git a/nixos/modules/services/video/epgstation/default.nix b/nixos/modules/services/video/epgstation/default.nix index 8d6d431fa55..b13393c8983 100644 --- a/nixos/modules/services/video/epgstation/default.nix +++ b/nixos/modules/services/video/epgstation/default.nix @@ -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 @@ -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 = [ { diff --git a/nixos/modules/services/web-apps/keycloak.nix b/nixos/modules/services/web-apps/keycloak.nix index f0b9e60116d..dc66c296656 100644 --- a/nixos/modules/services/web-apps/keycloak.nix +++ b/nixos/modules/services/web-apps/keycloak.nix @@ -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; diff --git a/nixos/modules/services/web-apps/tt-rss.nix b/nixos/modules/services/web-apps/tt-rss.nix index 6a29f10d119..b78487cc928 100644 --- a/nixos/modules/services/web-apps/tt-rss.nix +++ b/nixos/modules/services/web-apps/tt-rss.nix @@ -644,7 +644,7 @@ let services.mysql = mkIf mysqlLocal { enable = true; - package = mkDefault pkgs.mysql; + package = mkDefault pkgs.mariadb; ensureDatabases = [ cfg.database.name ]; ensureUsers = [ { diff --git a/nixos/tests/bitwarden.nix b/nixos/tests/bitwarden.nix index 3813a1f70f9..f64cf171f01 100644 --- a/nixos/tests/bitwarden.nix +++ b/nixos/tests/bitwarden.nix @@ -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"; diff --git a/nixos/tests/matomo.nix b/nixos/tests/matomo.nix index 2bea237c8bd..f6b0845749c 100644 --- a/nixos/tests/matomo.nix +++ b/nixos/tests/matomo.nix @@ -18,7 +18,7 @@ let }; services.mysql = { enable = true; - package = pkgs.mysql; + package = pkgs.mariadb; }; services.nginx.enable = true; }; diff --git a/nixos/tests/mysql/mysql-autobackup.nix b/nixos/tests/mysql/mysql-autobackup.nix index 65576e52a53..b0ec7daaf05 100644 --- a/nixos/tests/mysql/mysql-autobackup.nix +++ b/nixos/tests/mysql/mysql-autobackup.nix @@ -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; diff --git a/nixos/tests/mysql/mysql-backup.nix b/nixos/tests/mysql/mysql-backup.nix index d428fb6c16e..269fddc66e1 100644 --- a/nixos/tests/mysql/mysql-backup.nix +++ b/nixos/tests/mysql/mysql-backup.nix @@ -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 = { diff --git a/nixos/tests/mysql/mysql-replication.nix b/nixos/tests/mysql/mysql-replication.nix index ad84c801ea1..a52372ca47c 100644 --- a/nixos/tests/mysql/mysql-replication.nix +++ b/nixos/tests/mysql/mysql-replication.nix @@ -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; @@ -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; @@ -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; diff --git a/nixos/tests/sogo.nix b/nixos/tests/sogo.nix index 3f600b4cd55..acdad8d0f47 100644 --- a/nixos/tests/sogo.nix +++ b/nixos/tests/sogo.nix @@ -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"; diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index eec969f99ca..288f4fc078b 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/pkgs/development/lua-modules/overrides.nix @@ -173,7 +173,7 @@ with super; MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql"; }; buildInputs = [ - pkgs.mysql.client + pkgs.mariadb.client pkgs.libmysqlclient ]; });