1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-16 20:21:32 +03:00
mobile-nixos/modules/hardware-soc.nix
Samuel Dionne-Riel f40c8c1f08 modules: use types.str over types.string...
types.string having been formally deprecated, and having a likely
unwanted behaviour.
2019-09-18 15:28:51 -04:00

26 lines
528 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.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;
};
}