Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3f3f60215930
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 388d36951c50
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 18, 2018

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    21e9c35 View commit details

Commits on Nov 19, 2018

  1. Merge pull request #49735 from pvgoran/mysql-support-mysql57

    nixos/mysql: support package=mysql57
    lheckemann authored Nov 19, 2018
    Copy the full SHA
    388d369 View commit details
Showing with 13 additions and 3 deletions.
  1. +13 −3 nixos/modules/services/databases/mysql.nix
16 changes: 13 additions & 3 deletions nixos/modules/services/databases/mysql.nix
Original file line number Diff line number Diff line change
@@ -12,12 +12,22 @@ let
let
pName = _p: (builtins.parseDrvName (_p.name)).name;
in pName mysql == pName pkgs.mariadb;
isMysqlAtLeast57 =
let
pName = _p: (builtins.parseDrvName (_p.name)).name;
in (pName mysql == pName pkgs.mysql57)
&& ((builtins.compareVersions mysql.version "5.7") >= 0);

pidFile = "${cfg.pidDir}/mysqld.pid";

mysqldAndInstallOptions =
"--user=${cfg.user} --datadir=${cfg.dataDir} --basedir=${mysql}";
mysqldOptions =
"--user=${cfg.user} --datadir=${cfg.dataDir} --basedir=${mysql} " +
"--pid-file=${pidFile}";
"${mysqldAndInstallOptions} --pid-file=${pidFile}";
# For MySQL 5.7+, --insecure creates the root user without password
# (earlier versions and MariaDB do this by default).
installOptions =
"${mysqldAndInstallOptions} ${lib.optionalString isMysqlAtLeast57 "--insecure"}";

myCnf = pkgs.writeText "my.cnf"
''
@@ -253,7 +263,7 @@ in
if ! test -e ${cfg.dataDir}/mysql; then
mkdir -m 0700 -p ${cfg.dataDir}
chown -R ${cfg.user} ${cfg.dataDir}
${mysql}/bin/mysql_install_db ${mysqldOptions}
${mysql}/bin/mysql_install_db ${installOptions}
touch /tmp/mysql_init
fi