mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-16 11:43:21 +03:00
examples/hello: Try to enable ADB
Also warn if it could not be enabled.
This commit is contained in:
parent
a96c2b845c
commit
9d93f32eeb
@ -21,6 +21,19 @@ let
|
|||||||
fsType = "tmpfs";
|
fsType = "tmpfs";
|
||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Only enable `adb` if we know how to.
|
||||||
|
# FIXME: relies on implementation details. Poor separation of concerns.
|
||||||
|
enableADB =
|
||||||
|
let
|
||||||
|
value =
|
||||||
|
config.mobile.usb.mode == "android_usb" ||
|
||||||
|
(config.mobile.usb.mode == "gadgetfs" && config.mobile.usb.gadgetfs.functions ? adb)
|
||||||
|
;
|
||||||
|
in
|
||||||
|
if value then value else
|
||||||
|
builtins.trace "warning: unable to enable ADB for this device." value
|
||||||
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -73,11 +86,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Only enable `adb` if we know how to.
|
mobile.adbd.enable = lib.mkDefault enableADB;
|
||||||
# FIXME: relies on implementation details. Poor separation of concerns.
|
|
||||||
mobile.adbd.enable = (config.mobile.system.type == "android") &&
|
|
||||||
(config.mobile.usb.mode != "gadgetfs" || config.mobile.usb.gadgetfs.functions ? ffs)
|
|
||||||
;
|
|
||||||
|
|
||||||
boot.postBootCommands = lib.mkOrder (-1) ''
|
boot.postBootCommands = lib.mkOrder (-1) ''
|
||||||
brightness=10
|
brightness=10
|
||||||
|
Loading…
Reference in New Issue
Block a user