{ lib, ... }:

let
  vmCluster = import ./lib.nix { inherit lib; };
in
{
  ultracloud.cluster = {
    enable = true;
    name = vmCluster.clusterName;

    nodes = vmCluster.clusterNodes;

    deployer = {
      clusterId = vmCluster.clusterId;
      environment = vmCluster.environment;

      nodeClasses.control-plane = vmCluster.controlPlaneNodeClass;
      pools.control = vmCluster.controlPlanePool;
      hostDeployments = vmCluster.hostDeployments;
    };

    bootstrap.initialPeers = vmCluster.controlPlaneNodeNames;
    bgp.asn = vmCluster.bgpAsn;
  };
}
