anchor.diff:      ${optionalString (cfg.bind != null) "bind-address = ${cfg.bind}" }
       ${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "log-bin=mysql-bin"}
       ${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "server-id = ${toString cfg.replication.serverId}"}
  -    ${optionalString (cfg.replication.role == "slave" && !atLeast55)
  -    ''
  -      master-host = ${cfg.replication.masterHost}
  -      master-user = ${cfg.replication.masterUser}
  -      master-password = ${cfg.replication.masterPassword}
  -      master-port = ${toString cfg.replication.masterPort}
  -    ''}
       ${optionalString (cfg.ensureUsers != [])
       ''
         plugin-load-add = auth_socket.so
  
positive.code:   cfg = config.services.mysql;
  
    mysql = cfg.package;
    
    isMariaDB = 
      let
        pName = _p: (builtins.parseDrvName (_p.name)).name;
      in pName mysql == pName pkgs.mariadb;
  
    atLeast55 = versionAtLeast mysql.mysqlVersion "5.5";
  
    pidFile = "${cfg.pidDir}/mysqld.pid";
  
  
negative.code:                     ) | ${mysql}/bin/mysql -u root -N
                    ''}
  
                  ${optionalString (cfg.replication.role == "slave")
                    ''
                      # Set up the replication slave
  
  