2018-06-17 03:43:19 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2019-09-21 20:58:59 +03:00
|
|
|
inherit (lib) mkOption types;
|
2018-06-27 05:07:14 +03:00
|
|
|
cfg = config.mobile.hardware;
|
2018-06-17 03:43:19 +03:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.mobile.hardware = {
|
|
|
|
soc = mkOption {
|
|
|
|
# This is used to enable a specific SOC on a device, while giving it a name.
|
2019-09-13 05:23:13 +03:00
|
|
|
type = types.str;
|
2018-06-17 03:43:19 +03:00
|
|
|
description = ''
|
|
|
|
Give the SOC name for the device.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
assertions = [
|
2018-06-27 05:07:14 +03:00
|
|
|
{ assertion = cfg.socs ? ${cfg.soc}; message = "Cannot enable SOC ${cfg.soc}; it is unknown.";}
|
2018-06-17 03:43:19 +03:00
|
|
|
];
|
2018-06-27 05:07:14 +03:00
|
|
|
mobile.hardware.socs."${cfg.soc}".enable = true;
|
2018-06-17 03:43:19 +03:00
|
|
|
};
|
|
|
|
}
|