1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-14 18:21:41 +03:00
mobile-nixos/modules/hardware-soc.nix
2019-09-21 13:58:59 -04:00

25 lines
549 B
Nix

{ config, lib, pkgs, ... }:
let
inherit (lib) mkOption types;
cfg = config.mobile.hardware;
in
{
options.mobile.hardware = {
soc = mkOption {
# This is used to enable a specific SOC on a device, while giving it a name.
type = types.str;
description = ''
Give the SOC name for the device.
'';
};
};
config = {
assertions = [
{ assertion = cfg.socs ? ${cfg.soc}; message = "Cannot enable SOC ${cfg.soc}; it is unknown.";}
];
mobile.hardware.socs."${cfg.soc}".enable = true;
};
}