2020-04-04 21:57:23 +03:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (config) mobile;
|
2020-05-24 01:13:02 +03:00
|
|
|
inherit (mobile.device) identity;
|
2020-04-04 21:57:23 +03:00
|
|
|
in
|
|
|
|
{
|
|
|
|
# The device-metadata output is used internally by the documentation
|
|
|
|
# generation to generate the per-device pages.
|
|
|
|
# Assume this format is fluid and will change.
|
|
|
|
system.build.device-metadata = pkgs.writeTextFile {
|
|
|
|
name = "${mobile.device.name}-metadata";
|
|
|
|
destination = "/${mobile.device.name}.json";
|
|
|
|
text = (builtins.toJSON {
|
2020-05-24 01:13:02 +03:00
|
|
|
inherit (identity) name manufacturer;
|
2020-04-04 21:57:23 +03:00
|
|
|
inherit (mobile) hardware;
|
2020-12-18 02:35:54 +03:00
|
|
|
quirks = {
|
|
|
|
inherit (mobile.quirks) supportsStage-0;
|
|
|
|
};
|
2020-04-04 21:57:23 +03:00
|
|
|
system = {
|
|
|
|
inherit (mobile.system) type system;
|
|
|
|
};
|
|
|
|
identifier = mobile.device.name;
|
2020-05-24 01:13:02 +03:00
|
|
|
fullName = "${identity.manufacturer} ${identity.name}";
|
2020-04-04 21:57:23 +03:00
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|