{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://omaflake.dev/schema/image/v5.json",
  "title": "omaflake image",
  "description": "image.json in an image package (<name>.omaflake-image): what the image is. v2: look, lookChoice, credential, credentialName. v3 (plan B141): locale, localeName. v4 (plan B184): unchained. v5 (plan B206): fields.",
  "type": "object",
  "properties": {
    "$schema": {
      "const": "https://omaflake.dev/schema/image/v5.json"
    },
    "recipe": {
      "type": "string",
      "description": "Recipe ID <author>.<kind>.<name>@<words>"
    },
    "recipeSource": {
      "type": "string",
      "description": "The recipe source it was built from"
    },
    "author": {
      "type": "string"
    },
    "kind": {
      "enum": [
        "nixos",
        "macos"
      ],
      "description": "Guest kind"
    },
    "system": {
      "enum": [
        "aarch64-linux",
        "x86_64-linux",
        "aarch64-darwin"
      ],
      "description": "Architecture as Nix names a system"
    },
    "name": {
      "type": "string",
      "description": "The recipe's name"
    },
    "source": {
      "type": "string",
      "description": "The image flake it was built with (folder or URL)"
    },
    "revision": {
      "type": "string",
      "description": "The recipe's state when it was built"
    },
    "storePath": {
      "type": "string",
      "description": "NixOS: the image's store path; macOS: the nix-darwin system"
    },
    "look": {
      "type": "string",
      "description": "The guest look it was built with (v2; e.g. omaflake, catppuccin, rose-pine-dawn, vanilla) – left out for an image built before looks"
    },
    "lookChoice": {
      "type": "string",
      "description": "The look chosen for the build; left out: the recipe's own"
    },
    "credential": {
      "type": "string",
      "description": "The credential it was built with (its id); left out: this computer's values"
    },
    "credentialName": {
      "type": "string",
      "description": "That credential's name when it was built"
    },
    "locale": {
      "type": "string",
      "description": "The locale it was built with (its ID)"
    },
    "localeName": {
      "type": "string",
      "description": "That locale's name when it was built"
    },
    "unchained": {
      "description": "macOS: built from an unchained base (plan B184) – System Integrity Protection is off in the image and its VMs; such an image is never its recipe's current one. Left out when false",
      "type": "boolean"
    },
    "fields": {
      "type": "object",
      "description": "The modules' build fields it was built with, by module (\"author/name\") and field; fields left at their defaults are not here",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": {
          "type": [
            "string",
            "integer",
            "boolean"
          ]
        }
      }
    },
    "created": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "$schema",
    "recipe",
    "author",
    "kind",
    "system",
    "name",
    "source",
    "revision",
    "created"
  ],
  "additionalProperties": false
}
