demo: Enable adbd in burn tool
{ config, lib, pkgs, ... }:
let
- inherit (lib) mkMerge mkOrder;
+ device_info = config.mobile.device.info;
in
- {
- config = mkMerge [
{
# Ensures we don't quit stage-1
mobile.boot.stage-1.shell.enable = true;
+ # Only enable `adb` if we know how to.
+ # FIXME: relies on implementation details. Poor separation of concerns.
+ mobile.adbd.enable = (config.mobile.system.type == "android") &&
+ (config.mobile.usb.mode != "gadgetfs" || device_info.gadgetfs.functions ? ffs)
+ ;
# Enables networking and ssh in stage-1 !
mobile.boot.stage-1.networking.enable = true;
@@ -41,5 +44,3 @@ in
'')
];
}
- ];
-}
