{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Apps",
  "description": "Curated list of apps ordered by category",
  "type": "object",
  "additionalProperties": {
    "type": "array",
    "items": {
      "$ref": "#/$defs/AppPackage"
    }
  },
  "$defs": {
    "AppConfigPath": {
      "type": "object",
      "properties": {
        "dst": {
          "description": "Absolute path to the destination directory (~ may be used for $HOME)",
          "type": "string"
        },
        "src": {
          "description": "Optional path to the configuration relative to the repository root",
          "type": "string"
        }
      },
      "required": [
        "src",
        "dst"
      ]
    },
    "AppPackage": {
      "type": "object",
      "properties": {
        "config_path": {
          "description": "Optional definition of an application configuration directory.\n\nIf set the dotfiles manager will copy the directory from the profile into the $HOME directory.\nOnly possible if part of a dotfiles profile.",
          "type": "array",
          "default": [],
          "items": {
            "$ref": "#/$defs/AppConfigPath"
          }
        },
        "dependencies": {
          "description": "Packages that are installed with this package",
          "type": "array",
          "default": [],
          "items": {
            "type": "string"
          }
        },
        "description": {
          "type": "string"
        },
        "package_name": {
          "description": "The exact package name for the package manager",
          "type": "string"
        },
        "post_install_script": {
          "description": "Non-interactive bash script called after the installation of this item",
          "type": [
            "string",
            "null"
          ]
        },
        "preselected": {
          "description": "If set to true this item will be preselected",
          "type": "boolean",
          "default": false
        },
        "subcategory": {
          "type": "string"
        }
      },
      "required": [
        "subcategory",
        "package_name",
        "description"
      ]
    }
  }
}
