1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00
mobile-nixos/modules/hardware-soc.nix
2018-06-26 22:07:14 -04:00

26 lines
531 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
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.string;
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;
};
}