{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/spack-repos-yaml/latest.json",
  "title": "Spack repository configuration file schema",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/repos.json",
    "sourceSha256": "6816b963b55723e5c40367f86efd71963667994bfc6da7457cf01f4e5d081593",
    "fileMatch": [
      "**/*spack/**/repos.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "repos": {
      "description": "Configuration for package repositories that Spack searches for packages",
      "oneOf": [
        {
          "type": "array",
          "items": {
            "type": "string",
            "description": "Path to a Spack package repository directory"
          },
          "description": "Legacy format: list of local paths to package repository directories"
        },
        {
          "type": "object",
          "description": "Named repositories mapping configuration names to repository definitions",
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string",
                "description": "Path to a local Spack package repository directory containing repo.yaml and packages/"
              },
              {
                "type": "object",
                "properties": {
                  "git": {
                    "type": "string",
                    "description": "Git repository URL for remote package repository"
                  },
                  "branch": {
                    "type": "string",
                    "description": "Git branch name to checkout (default branch if not specified)"
                  },
                  "commit": {
                    "type": "string",
                    "description": "Specific git commit hash to pin the repository to"
                  },
                  "tag": {
                    "type": "string",
                    "description": "Git tag name to pin the repository to"
                  },
                  "destination": {
                    "type": "string",
                    "description": "Custom local directory path where the Git repository should be cloned"
                  },
                  "paths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of relative paths (from the Git repository root) that contain Spack package repositories (overrides spack-repo-index.yaml)"
                  }
                },
                "additionalProperties": false
              }
            ]
          }
        }
      ],
      "default": {}
    }
  },
  "additionalProperties": false
}
