Using custom hardware keyboard layout on iOS
Creating a hardware keyboard layout for iOS require you to assemble a .uchr file for the layout. This format is documented in the Unicode Utilities reference for the Carbon API. Such files could at one time be created with the klcompiler tool in the Font Tool Suite (!), except that it created big-endian output (probably from the PowerPC time) and iOS required little-endian output (more typical of the ARM processor), and this tool has since been retired from the Apple Download Centre, since it was 32-bits only (and there are only 64-bit versions of macOS remaining).

To install such a layout, it should be put in the /System/Library/KeyboardLayouts directory, which is not writable by the mobile user, but only by root. In addition, it is undocumented how new layouts are registered with the system - iOS does not scan this directory for new files as macOS does. A hack around this was to overwrite one of the existing layouts, e.g. USBKeyboardLayouts.bundle/uchrs/Colemak.uchr, and then select this one to activate it, but this would of course violate the checksum integrity of that layout.