1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 11:03:37 +03:00
mobile-nixos/modules/hardware-soc.nix

25 lines
549 B
Nix
Raw Normal View History

{ 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;
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 = [
2018-06-27 05:07:14 +03:00
{ assertion = cfg.socs ? ${cfg.soc}; message = "Cannot enable SOC ${cfg.soc}; it is unknown.";}
];
2018-06-27 05:07:14 +03:00
mobile.hardware.socs."${cfg.soc}".enable = true;
};
}