anchor.diff:    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";
   
  
positive.code: 
              ${concatMapStrings (user:
                ''
                  ( echo "CREATE USER IF NOT EXISTS '${user.name}'@'localhost' IDENTIFIED WITH ${if mysql == pkgs.mariadb then "unix_socket" else "auth_socket"};"
                    ${concatStringsSep "\n" (mapAttrsToList (database: permission: ''
                    echo "GRANT ${permission} ON ${database} TO '${user.name}'@'localhost';"
                    '') user.ensurePermissions)}
  
negative.code:         type = types.package;
          example = literalExample "pkgs.mysql";
          description = "
            Which MySQL derivation to use. MariaDB packages are supported too.
          ";
        };
  
  