JSON SchemaThe Horizon system supports converting JSON files to HorizonScript. This chapter describes the JSON schema supported by the Horizon JSON tooling.It is important to note that not all features of Horizon are available from JSON. For more advanced use cases, consider writing HorizonScript files directly. However, it is felt that supporting JSON interchange is important for interoperability with external systems.Overall document structureThere are two document formats supported by the Horizon JSON tooling. The most common is a simple structure where a single root object contains the Horizon JSON keys. The second, and less common, describes multiple configurations called "images" in a single JSON file. The root object contains a single key/value pair, images, which is an array of objects containing Horizon JSON keys. See for more information.Supported keyshostnameFormatStringShort DescriptionThe device's host name.Corresponding HorizonScript keyhostnamepackagesFormatArray of StringShort DescriptionA list of packages to install to the device.Corresponding HorizonScript keypkginstallrootpwFormatStringShort DescriptionThe encrypted root password for the device.Corresponding HorizonScript keyrootpwarchFormatStringShort DescriptionThe device's CPU architecture.Corresponding HorizonScript keyarchlanguageFormatStringShort DescriptionThe language to use for the device's interface.Corresponding HorizonScript keylanguagekeymapFormatStringShort DescriptionThe keyboard map to use for the device's hardware inputs.Corresponding HorizonScript keykeymapfirmwareFormatString or BooleanShort DescriptionDetermines whether or not the device will have non-free firmware installed.Corresponding HorizonScript keyfirmwareservicesFormatArray of ObjectShort DescriptionSpecifies additional services to start on device boot.Object Structureservice(String) The name of the service to start.runlevel(String) The runlevel that the service should start under. If no runlevel is specified, default is used.Corresponding HorizonScript keysvcenablenetconfigFormatStringShort DescriptionDetermines the network configuration system used on the device.Corresponding HorizonScript keynetconfigtypenetaddressesFormatArray of ObjectShort DescriptionSpecifies the device's network addressing configuration.Object Structureid(String) This connection's identifier. This field is for operator reference only - it will not appear in the HorizonScript or in the device's configuration.interface(String) The network interface to use for this address.addr-type(String) The type of this address: none to bring up the interface without an address (common for bridging), dhcp for DHCP, or static for static addressing.address(Object) The network address. Only valid if addr-type is static.
If static addressing is desired, the address object is described below.
ip-address(String) The IPv4 or IPv6 address for this connection.net-prefix(Number) The network prefix for this connection. Valid values are 1-32 for IPv4, and 1-128 for IPv6.gateway(String) The IPv4 or IPv6 address for the gateway for this connection.Corresponding HorizonScript keynetaddresspppoe_linksFormatArray of ObjectShort DescriptionSpecifies the device's PPPoE configuration.Object Structureinterface(String) The network interface to use for this PPPoE link.mtu(Number) The MTU for this PPPoE link. Default is 1472.username(String) The username to use for authenticating this PPPoE link.password(String) The passphrase/secret to use for authenticating this PPPoE link.lcp-echo-interval(Number) The number of seconds between LCP echo requests.lcp-echo-failure(Number) The number of echo request failures before this link is failed.Corresponding HorizonScript keypppoenameserversFormatArray of StringShort DescriptionIP addresses used for Domain Name System (DNS) resolution.Corresponding HorizonScript keynameserveraccess-pointsFormatArray of ObjectShort DescriptionSpecifies the device's wireless networking configuration.Object Structureinterface(String) The wireless network interface to use for this access point.ssid(String) The SSID for this access point.security(String) The security type to use for this access point: none, wep, or wpa.password(String) The shared secret to use for authenticating this wireless link.Corresponding HorizonScript keynetssidtimezoneFormatStringShort DescriptionThe time zone to use on the device.Corresponding HorizonScript keytimezonerepositoriesFormatArray of StringShort DescriptionThe APK repositories to use for package installation on the device.Corresponding HorizonScript keyrepositorysigningkeysFormatArray of StringShort DescriptionThe location of the signing key(s) used by the device's APK repositories.Corresponding HorizonScript keysigningkeyusersFormatArray of ObjectShort DescriptionSpecifies the device's user accounts.Object Structureusername(String) The login name of this account.alias(String) The friendly name/GECOS of this account.passphrase(String) The encrypted passphrase to use to authenticate to this account. See for information about the format of passphrase.groups(String) Comma-separated list of this account's member groups.Corresponding HorizonScript keysusername, useralias, userpw, usergroupsExamplesBasic example of Horizon JSON file
{
"hostname": "horizon-json-testmachine.adelielinux.org",
"packages": ["adelie-base-posix", "easy-kernel", "easy-kernel-modules",
"netifrc", "openrc", "s6-linux-init"],
"rootpw": "...",
"root": "/dev/sda1",
"netaddresses": [{"id":"eth0", "interface":"eth0", "addr-type":"dhcp"}],
"nameservers": ["9.9.9.9"],
"timezone": "America/Chicago",
"repositories": ["https://distfiles.adelielinux.org/adelie/1.0/system",
"https://distfiles.adelielinux.org/adelie/1.0/user"],
"signingkeys": ["/etc/apk/keys/powerpc-1@packages.adelielinux.org.pub",
"/etc/apk/keys/powerpc-2@packages.adelielinux.org.pub"]
}
Example of multi-configuration Horizon JSON file
{"images":
[
{"name": "Test Image",
"hostname": "horizon-json-testmachine.adelielinux.org",
"packages": ["adelie-base-posix", "easy-kernel", "easy-kernel-modules",
"netifrc", "openrc", "s6-linux-init"],
"rootpw": "...",
"root": "/dev/sda1",
"arch": "ppc64",
"language": "en_GB.UTF-8",
"keymap": "us",
"firmware": false,
"netconfig": "netifrc",
"netaddresses": [{"id":"eth0", "interface":"eth0", "addr-type":"dhcp"}],
"nameservers": ["9.9.9.9"],
"timezone": "America/Chicago",
"repositories": ["https://distfiles.adelielinux.org/adelie/1.0/system",
"https://distfiles.adelielinux.org/adelie/1.0/user"],
"signingkeys": ["/etc/apk/keys/powerpc-1@packages.adelielinux.org.pub",
"/etc/apk/keys/powerpc-2@packages.adelielinux.org.pub"]
}
]
}