Change:
cmakeFlags = common.cmakeFlags ++ [ "-DMYSQL_DATADIR=/var/lib/mysql" <del> "-DINSTALL_SYSCONFDIR=etc/mysql" "-DINSTALL_INFODIR=share/mysql/docs" "-DINSTALL_MANDIR=share/man" </del> "-DINSTALL_PLUGINDIR=lib/mysql/plugin" <del> "-DINSTALL_SCRIPTDIR=bin" "-DINSTALL_SUPPORTFILESDIR=share/mysql" "-DINSTALL_DOCREADMEDIR=share/doc/mysql" "-DINSTALL_DOCDIR=share/doc/mysql" "-DINSTALL_SHAREDIR=share/mysql" "-DINSTALL_MYSQLTESTDIR=OFF" "-DINSTALL_SQLBENCHDIR=OFF" "-DENABLED_LOCAL_INFILE=ON" </del> <ins> "-DENABLED_LOCAL_INFILE=OFF" </ins> "-DWITH_READLINE=ON" <del> "-DWITH_EXTRA_CHARSETS=complex" "-DWITH_EMBEDDED_SERVER=ON" "-DWITH_ARCHIVE_STORAGE_ENGINE=1" "-DWITH_BLACKHOLE_STORAGE_ENGINE=1" "-DWITH_INNOBASE_STORAGE_ENGINE=1" "-DWITH_PARTITION_STORAGE_ENGINE=1" "-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1" "-DWITHOUT_FEDERATED_STORAGE_ENGINE=1" </del> <ins> "-DWITH_EXTRA_CHARSETS=all" "-DWITH_EMBEDDED_SERVER=OFF" "-DWITH_UNIT_TESTS=OFF" </ins> "-DWITH_WSREP=ON" "-DWITH_INNODB_DISALLOW_WRITES=ON" <ins> "-DWITHOUT_EXAMPLE=1" "-DWITHOUT_FEDERATED=1" </ins> ] ++ stdenv.lib.optionals stdenv.isDarwin [ <del> "-DWITHOUT_OQGRAPH_STORAGE_ENGINE=1" </del> <ins> "-DWITHOUT_OQGRAPH=1" </ins> "-DWITHOUT_TOKUDB=1" ]; <del> postInstall = common.postInstall + '' </del> <ins> preConfigure = '' cmakeFlags="$cmakeFlags  -DINSTALL_SHAREDIR=$dev/share/mysql -DINSTALL_SUPPORTFILESDIR=$dev/share/mysql" ''; postInstall = '' chmod +x "$out"/bin/wsrep_sst_common </ins> rm -r "$out"/data # Don't need testing data <del> rm "$out"/share/man/man1/mysql-test-run.pl.1 rm "$out"/bin/rcmysql </del> <ins> rm "$out"/bin/{mysql_find_rows,mysql_waitpid,mysqlaccess,mysqladmin,mysqlbinlog,mysqlcheck} rm "$out"/bin/{mysqldump,mysqlhotcopy,mysqlimport,mysqlshow,mysqlslap,mysqltest} rm "$out"/lib/mysql/plugin/{auth_gssapi_client.so,client_ed25519.so,daemon_example.ini} rm "$out"/lib/{libmysqlclient.so,libmysqlclient_r.so} mv "$out"/share/{groonga,groonga-normalizer-mysql} "$out"/share/doc/mysql mkdir -p "$dev"/lib && mv "$out"/lib/{libmariadbclient.a,libmysqlclient.a,libmysqlclient_r.a,libmysqlservices.a} "$dev"/lib </ins> '' + optionalString (! stdenv.isDarwin) '' sed -i 's/-mariadb/-mysql/' "$out"/bin/galera_new_cluster '';

Discussion:
mysqlupgrade requires availability of mysqlcheck, which is in the package In other operating systems they are separated - mysqlupgrade -, mysqlcheck - And when the server is installed the client is automatically installed.
Hmm, is there a reason not to make the client a dependency of the server? The only dependencies the client has that the server doesn't are and which any server should have (via openssh). How much space is saved by removing the client binaries?
So it seems the mysql_upgrade binary is hardcoded to expect the other binaries in the same directory: Probably the splitting works on other distros because the binaries all end up in /usr/bin anyway.
Need to build the package with server+client and only client? Is this variant bad?
I'm not sure what you mean. Can you check to see if the project cmake allows you to configure a different install PREFIX for the client/server?
Should I change the build of MariaDB, so that one package includes files for both server and client, and the other package only includes client files? I don't know how to configure this
19.09 milestone? If this and aren't resolved by then we will have to add the client binaries back into the server package.
- this variant optimal?
update MariaDB configuration, please check this variant.
Fixed, mariadb package includes server and client binaries.