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 = "//192.168.0.99/nas";
    fsType = "cifs";
    options = [
      "credentials=${config.sops.templates."samba-nas".path}"
      "x-systemd.automount"
      "noauto"
      "x-systemd.idle-timeout=60"
      "x-systemd.device-timeout=5s"
      "x-systemd.mount-timeout=5s"
      "rw"
      "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)