1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00
mobile-nixos/modules/devices-metadata.nix
Samuel Dionne-Riel ec7a2d120d devices-metadata: Export documentation config
Since *anyway* this is mainly intended to be consuemd by the
documentation.
2021-01-09 19:23:20 -05:00

29 lines
820 B
Nix

{ config, pkgs, ... }:
let
inherit (config) mobile;
inherit (mobile.device) identity;
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 {
inherit (identity) name manufacturer;
inherit (mobile) hardware;
inherit (mobile) documentation;
quirks = {
inherit (mobile.quirks) supportsStage-0;
};
system = {
inherit (mobile.system) type system;
};
identifier = mobile.device.name;
fullName = "${identity.manufacturer} ${identity.name}";
});
};
}