How to create named container volumes?

There is an option to define which volumes should get mounted into a container but I couldn’t find an option on how to define a named volume.
How would one do that?

This post talks about system.activationScripts which might be an option but feels a bit inelegant:

Got it working with extra options. Not really pretty.

  virtualisation.oci-containers = {
    backend = "docker";
    containers."heimdall" = {
      image = "linuxserver/heimdall";
      autoStart = true;
      environment = {
        TZ = "Europe/Zurich";
        PUID = "1000";
        PGID = "100";
      };
      ports = [
        "8081:80"
      ];
      extraOptions = [
        ''--mount=type=volume,source=heimdall,target=/config,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:/server_data/heimdall,"volume-opt=o=addr=10.10.0.12,rw,nfsvers=4.0,nolock,hard,noatime"''
      ];
    };
  };