mysql service: change default data directory for 17.09
The new directory is now moved to /var/lib/mysql. This makes it consistent with
with upstream.
commitf469bd83bb9390807f1cdbe2de8d56bb8a710eb5
authorPascal Bach <pascal.bach@nextrem.ch>
dateSat 20 May 2017, 00:30 (10 years ago)
parent9f6b1dc
nixos/modules/services/databases/mysql.nix+5−1
@@ -72,7 +72,7 @@ in
7272
7373 dataDir = mkOption {
7474 type = types.path;
75− default = "/var/mysql"; # !!! should be /var/db/mysql
75+ example = "/var/lib/mysql";
7676 description = "Location where MySQL stores its table files";
7777 };
7878
@@ -166,6 +166,10 @@ in
166166
167167 config = mkIf config.services.mysql.enable {
168168
169+ services.mysql.dataDir =
170+ mkDefault (if versionAtLeast config.system.stateVersion "17.09" then "/var/lib/mysql"
171+ else "/var/mysql");
172+
169173 users.extraUsers.mysql = {
170174 description = "MySQL server user";
171175 group = "mysql";