mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-16 20:21:32 +03:00
26 lines
533 B
Nix
26 lines
533 B
Nix
|
{ config, lib, pkgs, ... }:
|
||
|
|
||
|
with lib;
|
||
|
|
||
|
let
|
||
|
cfg = config.mobile.hardware.soc;
|
||
|
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 = mobile.hardware.socs ? cfg; message = "Cannot enable SOC ${cfg}; it is unknown."; }
|
||
|
];
|
||
|
mobile.hardware.socs."${cfg}".enable = true;
|
||
|
};
|
||
|
}
|