# System Configuration
#
# Hybrid pattern: defaults + makers + instances

let contracts_lib = import "./contracts.ncl" in
let defaults_lib = import "./defaults.ncl" in

{
  defaults = defaults_lib,

  # Maker functions (not exported)
  make_system_config | not_exported = fun overrides =>
    defaults_lib.SystemConfig & overrides,

  make_orchestrator_config | not_exported = fun overrides =>
    defaults_lib.OrchestratorConfig & overrides,

  make_database_config | not_exported = fun overrides =>
    defaults_lib.DatabaseConfig & overrides,

  make_control_center_config | not_exported = fun overrides =>
    defaults_lib.ControlCenterConfig & overrides,

  make_kms_config | not_exported = fun overrides =>
    defaults_lib.KMSConfig & overrides,

  make_platform_services | not_exported = fun overrides =>
    defaults_lib.PlatformServicesConfig & overrides,

  make_credentials_ref | not_exported = fun overrides =>
    defaults_lib.ProviderCredentialsReference & overrides,

  make_upcloud_config | not_exported = fun overrides =>
    defaults_lib.UpCloudConfig & overrides,

  make_aws_config | not_exported = fun overrides =>
    defaults_lib.AWSConfig & overrides,

  make_hetzner_config | not_exported = fun overrides =>
    defaults_lib.HetznerConfig & overrides,

  make_local_config | not_exported = fun overrides =>
    defaults_lib.LocalConfig & overrides,

  make_rustyvault_bootstrap | not_exported = fun overrides =>
    defaults_lib.RustyVaultBootstrap & overrides,

  make_provider_config | not_exported = fun overrides =>
    defaults_lib.ProviderConfig & overrides,

  make_user_preferences | not_exported = fun overrides =>
    defaults_lib.UserPreferences & overrides,

  make_workspace_config | not_exported = fun overrides =>
    defaults_lib.WorkspaceConfig & overrides,

  # Default instances
  DefaultSystemConfig = defaults_lib.SystemConfig,
  DefaultOrchestratorConfig = defaults_lib.OrchestratorConfig,
  DefaultDatabaseConfig = defaults_lib.DatabaseConfig,
  DefaultControlCenterConfig = defaults_lib.ControlCenterConfig,
  DefaultKMSConfig = defaults_lib.KMSConfig,
  DefaultPlatformServicesConfig = defaults_lib.PlatformServicesConfig,
  DefaultProviderCredentialsReference = defaults_lib.ProviderCredentialsReference,
  DefaultUpCloudConfig = defaults_lib.UpCloudConfig,
  DefaultAWSConfig = defaults_lib.AWSConfig,
  DefaultHetznerConfig = defaults_lib.HetznerConfig,
  DefaultLocalConfig = defaults_lib.LocalConfig,
  DefaultRustyVaultBootstrap = defaults_lib.RustyVaultBootstrap,
  DefaultProviderConfig = defaults_lib.ProviderConfig,
  DefaultUserPreferences = defaults_lib.UserPreferences,
  DefaultWorkspaceConfig = defaults_lib.WorkspaceConfig,
}
