How to run a dockertools built image with virtualisation.oci-containers.containers?

Hi,
coincidentally I was asking a different but similar question about dockerTools. My setup described in this comment may help you.

You can assign directly

nixosConfigurations."mySystem" = nixpkgs.lib.nixosSystem {
      system = system;
      modules = [
        ...
        {
          virtualisation.docker.enable = true;
          virtualisation.oci-containers.containers."buildResult".imageFile = (pkgs.dockerTools.buildImage { ... });
        }
      ];
    };

See the example field in the nixos options. In my post I wasn’t able to finish the setup due different error so this explanation isn’t tested but I believe it should be good.