Samba mount directory mode

How to declaratively mount a samba share with a specific directory mode?

I would like to mount share that servers as nas for linux and windows machines. Samba share is on LAN.

I see that cifs mount does not support setting dmask/umask and changing directory mode manually via chmod does not work either, it remains 755 for some reason

I use following configuration for mounting:

  fileSystems."/run/media/nas" = {
    device = "//";
    fsType = "cifs";
    options = [
      "uid=${builtins.toString config.users.users.myuser.uid}"
      "gid=${builtins.toString config.users.groups.users.gid}"

Recommendation on SO thread is to either use subdirectories or pam_mount. First does not help since the target mount is still 755 while I want group members to have write access. The other adds the whole new service that is only used to permorm seemingly trivial operation(same with gvfs)