How to mount network shares to use as data storage

I would like to use the following service options and store my data on my unraid file storage. It is mainly about mysql and nextcloud:


Unfortunately I get authorization errors no matter if I mount with nfs or smb. How do I have to mount a network share so that the two options for mysql and nextcloud work?

This is the nfs mount for example

fileSystems."/mnt/Daten" = {
    device = "";
    fsType = "nfs4";
    options = [ "rsize=32768,wsize=32768,noatime,async" ];

this is the bind mount:

fileSystems."/var/lib/mysql" = {
  depends = [
      # The mounts above have to be mounted in this given order
  device = "/mnt/Daten/Mysql";
  fsType = "none";
  options = [

This are the permissions:

drwxrwxrwx  1 specter       users           28 18. Jun 11:20 mysql

This is the error:

 mysql.service: Failed to set up special execution directory in /var/lib: Operation not permitted